Thanks to Lindas help and maxidvds initial code, I now have this module turning zone tables on or off according to their weight.
I had to tweak it a bit to only show the right table according to the weight.
Here's what I did (note that the weights are in grams);
Immediately beneath the closing '}' of this code;
Add this code;PHP Code:// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_ZONETABLE_STATUS == 'True') ? true : false);
}
The above code disables the zone for any weights over 3kgs (3000 grams) (and defaults to courier for us)PHP Code:// Scotts mod: Enable only if cart contents are LESS than 3kg
global $cart;
if ($_SESSION['cart']->show_weight() > 3000) {
$this->enabled = false;
}
This code enables the other zone table (in our case Australia Post)
The initial code, if it had both tables set to the same weight (3000 in this case) - they would both show on an order weighing exactly 3kgs. So I set the second block of code to 3001.PHP Code:// Scotts mod: Enable only if cart contents are HEAVIER than 3kg
global $cart;
if ($_SESSION['cart']->show_weight() < 3001) {
$this->enabled = false;
}
This code will work for lbs too, just set a much smaller number ;)



Reply With Quote
