#StackBounty: #magento-1.9 #database #ce-1.9.0.1 #ce-1.9.1.0 #magento1.9.3 How to add more pincodes in Cash on Delivery restriction mod…

Bounty: 50

I am using custom module Cash on delivery restriction by zipcodes for magento 1.9.3.7

enter image description here
I am having issue to add pincode more than 10 thousand. This module only excepts 8 thousand pincodes.

here is Observer class

public function getCashOnDelvery(Varien_Event_Observer $observer) {
    $event           = $observer->getEvent();
    $method          = $event->getMethodInstance();
    $result          = $event->getResult();
    $isModuleEnable = Mage::getStoreConfig('cod/cod/enable');

    if($isModuleEnable) {

        if($method->getCode() == 'phoenix_cashondelivery' ){

            $quote = Mage::getSingleton('checkout/cart')->getQuote();
            $add = $quote->getShippingAddress();
            $postcode = $add->getData('postcode');

            $comparisonMode = Mage::getStoreConfig('cod/cod/mode');
            $zipCodes = Mage::getStoreConfig('cod/cod/zipcode');
            $isExist = false;

            if(trim($zipCodes) == '') {             
                $result->isAvailable = true;
            } else {    

                if(strpos($zipCodes, $postcode) !==  false) {
                    $isExist = true;
                }


                if($isExist != true) {

                    $zipCodesArray = explode(',', nl2br($zipCodes));
                    if(count($elementLineArray) > 1) {
                        foreach($zipCodesArray as $codzipLine) {
                            $elementLineArray = explode('-', $codzipLine);
                            if(count($elementLineArray) == 2 && ( $postcode >= $elementLineArray[0] && $postcode <= $elementLineArray[1] )) {
                                $isExist = true;
                                break;
                            } else if($postcode == $codzipLine) {
                                $isExist = true;
                                break;
                            }
                        }
                    }
                }

                $returnValue = '';
                    $returnValue = ($isExist)?true:false;

                $result->isAvailable = $returnValue;

            }   

        } 
    }   
}

}

can anyone help me to resolve this issue. is there any limitation for data saving. How can I add more than 10 thousand zipcodes?


Get this bounty!!!

Leave a Reply