As built and like RodG was saying, the code doesn't offer a specific application of a shipping module to a product, or any variation of that. But, it is built to support adding such code. Personally I was hoping that one of the below related links might offer the routine questions that are asked (but then RodG asked them
). One thing not really answered though is what is to happen if a purchase includes one of the products to be applied to the special zone rate as well as a product not normally to be provided that zone rate? Should the zone based shipping option be available to be applied against the entire order or should it not exist?
Generally speaking in the quote section of the code is where some additional code could be added to disable a method if it doesn't meet desired conditions. In this case, it would be likely somewhere in this region that such code could be added:
Code:
for ($i=1; $i<=$this->num_zones; $i++) {
$countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i);
$countries_table = strtoupper(str_replace(' ', '', $countries_table));
$country_zones = preg_split("/[,]/", $countries_table);
if (in_array($dest_country, $country_zones)) {
$dest_zone = $i;
break;
}
if (in_array('00', $country_zones)) {
$dest_zone = $i;
break;
}
}
BTW, if there are # symbols, ignore them/treat them like spaces. I copied the above code from github and sometimes spaces get replaced with # symbols when I do so.
So in that region, it seems (and untested) that during the loop if the product in the $order variable (should be looped through as well) is not going to the applicable zone then the $dest_zone should be set to 0. This will cause the applicable zone rate to be disabled.
Bookmarks