To illustrate Ajeh's point, I have a clone of zonetables shipping module, and modified the code as follows to govern the display of the module (shipping option) based on the weight:-
Code:
function zonetable() {
global $order, $db, $total_weight;
// CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
$this->num_zones = 6;
$this->code = 'zonetable';
$this->title = MODULE_SHIPPING_ZONETABLE_TEXT_TITLE;
$this->description = MODULE_SHIPPING_ZONETABLE_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_ZONETABLE_SORT_ORDER;
$this->icon = '';
$this->tax_class = MODULE_SHIPPING_ZONETABLE_TAX_CLASS;
$this->tax_basis = MODULE_SHIPPING_ZONETABLE_TAX_BASIS;
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_ZONETABLE_STATUS == 'True') ? true : false);
}
// Minimum Shipping Weight: If the shipping weight less than 2Kg disable the module
if ($total_weight < 2) {
$this->enabled = false;
}
(parts I added are in red).
PS: a SECOND clone I made (zonetablestwo) reverses the limiter and shows another module when the weight is MORE THAN 2kg.
Simply reverse:
Code:
// Minimum Shipping Weight: If the shipping weight more than 2Kg disable the module
if ($total_weight > 2) {
$this->enabled = false;
}
Bookmarks