lalabell Posted September 3, 2013 Share Posted September 3, 2013 Hi, I am looking for a way to change the shipping fee, to adjust the cost by states of my country I tried to follow this tutorial, but it gives me an internal error, (parse error for the bold text) So can anyone help me ? how to correct it or any other way to do? I tried to pass by fee by zone, but 1 country can't belong to many zones, so it doesn't help Thank you 1) Copy "classes/Address.php" to "override/classes/Address.php". 2) In line 28 change class name from AddressCore to Address 3) Before function getZoneById, paste this new function /*** Return postcode of address** @param $id_address Address id* @return integer postcode*/public static function getPostcodeByAddress($id_address){$row = Db::getInstance()->getRow('SELECT `postcode`FROM '._DB_PREFIX_.'address aWHERE a.`id_address` = '.(int)($id_address));return $row['postcode'];} 4) Add before first line of function getZoneById this: $postcode=self::getPostcodeByAddress($id_address);if(in_array($postcode,array(your list of postcodes)){return id-of-your-zone;}else Link to comment Share on other sites More sharing options...
Emmanuel M. Posted September 3, 2013 Share Posted September 3, 2013 Hi, Are you trying to apply different fees depending on the postcode of the customer? Because I have a module for this: http://addons.prestashop.com/en/shipping-logistics-delivery-prestashop-modules/5711-zones-by-zip-codes.html Regards, Emmanuel Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now