No Comments

Customize magento module

How to achieve magento product media image uploaded in custom module
Magento quick report of how many product online (frontend!) per brand

I have a magento module which shows which checks available zip codes.
In admin panel i have to add zip codes which need to be restricted and all other zip codes become available.I want to change its function such that the zip codes i add in backend are available and all other become unavailable.

/template/shippingrestriction/index.phtml

<script>
function Checkshipping()
{
        var zipcode = document.getElementById('zipcode').value;
        jQuery( "#result" ).empty();

        if (zipcode == '')
        {
            jQuery("#zipcode").css("border","1px dotted #E84100");return false; 
        }
        jQuery.ajax({
        type:"POST",
        xhrFields: {
        withCredentials: false
        },
        url:"<?php echo Mage::getBaseUrl();?>shippingrestriction/index/front",
        data:{'zipcode':zipcode},
        success: function (data, status) {
                jQuery("#zipcode").css("border","none");
                jQuery( "#result" ).empty(data);
                jQuery( "#result" ).append(data);

            },
        error: function (xhr, desc, err) { 

            alert("Error Processing your request!Please try again later!");
            alert(xhr.toSource());
            alert("Desc: " + desc + "nErr:" + err);
        }    
        });
}
</script>
    <input type="text" id="zipcode">
    <button onclick="Checkshipping()" title="Continue" class="button" type="button"><span><span>Check</span></span></button>
    <div id ="result"></div>

do i have to do anything with this.
I am not a coder!

Related Posts

  • How to upload multiple images using jQuery Form Post via Ajax? (0)
    jQuery var formData = new FormData(jQuery('form[name="my_form"]').get(0)); var urlAddress = "<?php echo Mage::getUrl('frontname/controller/action'); ?>"; jQuery.ajax({ url: urlAddress, data: formData, type: 'POST', contentType: false, processData: false, […]
  • How to send email to customer in custom form in existing module? (1)
    I want send email to customer. i create form on product view page. when clicking on image the form is open in dialogue box. i want send the mail to customer after form submission. please help My code is: in app/design/frontend/sm-market/default/catalog/product/view/addto.phtml […]
  • get the zip code along with messsage (2)
    When we click on "zip code" & enter "check" button, Then we are displaying "Available with 14 sellers" , in front of that text, i want to display entered zip code : "110001". I need :" Available with 14 sellers 110001 " result.phtml <p> <?php echo "Available with […]
  • Magento1.9.2.4 Create Custom Admin Login (0)
    I am trying to create a Custom admin login, I have created a module in frontend with login template. When the form is submitted then i have used below code in the controller action, Mage::getSingleton('core/session', array('name' => 'adminhtml')); $data = […]
  • jquery not defined error in magento 2 (1)
    I am trying to bring banner scroll in magento2. I am using owl carousel for this purpose. Everything have done and implemented and is showing in firefox without any errors. But when checked in chrome, i found jquery not defined error. After some diggings, i found we need to use call […]
  • Custom zip folder dont give option for save or open in browser (1)
    I have created a zip file programmatically. Zip is created on destination folder with specific files. But after creating that zip file why I am not getting an option to download (save) or open that zip file in browser ? Please look in my code. function cretezipAction() { […]
  • Remember zip code after we visit other Product page (3)
    we are using custom module for checking COD is available or not in view page. we entered zip code and checked "COD is available or not", now if we click on other product page, it should remember the zip code that we entered last time & should display message by […]
  • Magento Customer created from code not login to the website (1)
    I am creating a customer from the code for a specific group code created a new record in the customer_entity table but when I try to login from the website its shows invalid username or password error while the customer created from the magento admin panel working fine and login to […]
  • How to display success message after ajax form summit (2)
    I've been working on this code I found somewhere. I use it to submit the Send to Friend form from a popup. It works but I can't get it to display the success message after it submits the form. Right now after it submits the form it just disappears. Maybe someone good at ajax can see […]
  • Loading Spin and Disable button in magento (1)
    I have this function which is called after the button was clicked, I would like to disable the button until the alert comes up and to show a Loading Spin while it is not finished processing the feed. This is my function code: jQuery.noConflict(); function generateFeed(feedId) { […]
How to achieve magento product media image uploaded in custom module
Magento quick report of how many product online (frontend!) per brand

Be the first to post a comment.

Add a comment