Someone had written a shipping mod based on the flat rate module for Australia Post rates. After making template changes to the site, the customer reported that the shipping was no longer working correctly. There's a choice between post and express post and no matter what you chose on checkout shipping, the first of the 2 choices showed up on the payment page.
Looking at the mod, I thought that there was no way it ever worked before due to way the array or lack of array was written. I opted to write another module separating out the 2 choices. The flat module has the international shipping, domestic flat rate and book rate. The express module has only the express rate.
Went back and checked out and the same - but different - thing is still happening. Only the flat rate gets put in to the payment page where as before only the first rate got put in.
Any other module besides these two that is chosen works. I've looked at the two modules and checked the database for extra shipping configurations that shouldn't be there. But I can't see why this would be happening.
I've written new flat rate modules before so I'm not clueless but I'm definitely not seeing the problem.
The only difficulty I'm looking at is the zone. The flat domestic has an if statement for if international as follows and I'm wondering if this has anything to do with the problem. There's a dated comment where someone might have made a change last December that created this - maybe not.
PHP Code:
if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
$check_flag = false;
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLAT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
while (!$check->EOF) {
if ($check->fields['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
$check->MoveNext();
}
if ($check_flag == false) { //this order is international shipping
// $this->enabled = false;
$this->is_international = true;
$this->enabled = false; //12/18/2009, 17:52:43 by Hao to disable flat shipping when international is on
}
Bookmarks