For PS1.4.7.
I have one carrier that delivers only for certain zip-codes. All of them in the same state.
Using default PS behaviour, a carrier is assigned for a zone... and the zone "is made" of states.
We cannot divide states into smaller parts.
So, just in case someone need this, I figured out a simply way to achieve this.
- I added a zone for my collection of postcodes
- I set up a carrier fot that zone
And in controllers/ParentOrderController.php, protected function _assignCarrier(), in line ~363 I made this change:
Before:
$id_zone = Address::getZoneById((int)($address->id));
After:
if(($address->id_state==348)&& in_array($address->postcode,array(31001,31014))){
$id_zone=13;
}else $id_zone = Address::getZoneById((int)($address->id));
This is an example. In my case, all of my postcodes belongs to the same state. If it is not your case, just delete the part "($address->id_state=xxx)
Luk.