show cod in magento on some zip codes

show cod in magento on some zip codes

add code like below will work for you

if($quote && $quote->getBaseGrandTotal()<Mage::getStoreConfig('payment/mpcashondelivery/max_order_total') && $quote->getBaseGrandTotal()>Mage::getStoreConfig('payment/mpcashondelivery/max_order_total')) {
            return false;
        }
        $specificcountry = explode(",",Mage::getStoreConfig('payment/mpcashondelivery/specificcountry'));
        if(Mage::getStoreConfig('payment/mpcashondelivery/allowspecific')!=0 ){
            if(!in_array($quote->getBillingAddress()->getCountry(),$specificcountry)){
                return false;
            }
        }
         $cod_charges = Mage::getModel('mpcashondelivery/pricerules')->getAppliedPriceRules();
        if($cod_charges['error']){            
            return false;
        }
       $restrictedZips = array(
           '641004'
          ,'641006'
             );

         $address = $quote->isVirtual() ? $quote->getBillingAddress() : $quote->getShippingAddress();
          $customerZip = $address->getPostcode();
      if (!in_array($customerZip, $restrictedZips)) {
         return false;
       }
        }
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

Install the PHP Extension (ionCube Loader) Required by Watch My Domains SED

Next Post

Magento function most useful

Related Posts

PHP Cracked code of codecanyon php script lifetime edition part 1

PHP Cracked code of codecanyon php script lifetime edition part 1 http://codecanyon.net/item/spruce-sales-crm/13506232            $30 http://codecanyon.net/item/fancy-product-designer-opencart-extension/9522197?s_phrase=&s_rank=5              $45 http://codecanyon.net/item/besmabulk-email-and-sms-marketing-application/8785256?s_rank=1         …
Read More