Different maximum shipping weights for different shipping modules
Hello !
I set up 2 different "per weight unit" modules (I made a clone) with different rates, one for normal shipping, and one for small packages. The problem is, the small package rate is supposed to be only for packages under 2 kg, so I need to have a 2 kg limit for this module. But I need to keep my 50kg limit for the normal shipping module.
How can I have a different weight limit for each module ?
Thank you for your help.
Re: Different maximum shipping weights for different shipping modules
You could add to the modules:
Code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_PERWEIGHTUNIT_STATUS == 'True') ? true : false);
}
// bof: turn off for weight over 2
if (!IS_ADMIN_FLAG) {
global $cart;
if ($_SESSION['cart']->show_weight() > 2) {
$this->enabled = false;
}
}
// eof: turn off for weight over 2
Re: Different maximum shipping weights for different shipping modules
That worked, thank you so much !!
Re: Different maximum shipping weights for different shipping modules
Thanks for the update that this was able to work for you ... :smile:
Re: Different maximum shipping weights for different shipping modules
hi..Ajeh...
following code from file zone.php...I have install muiltple-shipping-zone- module.........
if (IS_ADMIN_FLAG === true) {
// build in admin only additional zones_5 if missing in the configuration table due to customization of default $this->num_zones_5 = 3
global $db;
for ($i = 1; $i <= $this->num_zones_5; $i++) {
$check = $db->Execute("select * from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_5_COUNTRIES_" . $i . "'");
if ($this->enabled && $check->EOF)
I was trying to limit maximum allow weight 2 kg for this shipping module...Please help...
I was tyring to figure out but above code is quite different...I do want to mess anymore..becoz I m new with php coding and I already have done....
I was trying
Re: Different maximum shipping weights for different shipping modules
Quote:
Originally Posted by
inder
hi..Ajeh...
following code from file zone.php...I have install muiltple-shipping-zone- module.........
if (IS_ADMIN_FLAG === true) {
// build in admin only additional zones_5 if missing in the configuration table due to customization of default $this->num_zones_5 = 3
global $db;
for ($i = 1; $i <= $this->num_zones_5; $i++) {
$check = $db->Execute("select * from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_5_COUNTRIES_" . $i . "'");
if ($this->enabled && $check->EOF)
I was trying to limit maximum allow weight 2 kg for this shipping module...Please help...
I was tyring to figure out but above code is quite different...I do want to mess anymore..becoz I m new with php coding and I already have done....
I was trying
Thank you Ajeh,,,,I found solution from your other threads...
Thank you again...
Regards Inder.
Re: Different maximum shipping weights for different shipping modules
hi Ajeh...
it was working perfectly fine for me...
I have installed two shipping options...second option has maximum weight limit of 2 kg (above code is working perfectly fine.thank you for that..) but suddently I realized that no matter what option do the customers select, the next page shows only other expensive selection....I deactived and actived tried ....what else I can do? ....I tried to find other threads but nothing found same thank you advance.....
Re: Different maximum shipping weights for different shipping modules
I am not sure what you are doing with the code you posted ...
The Zone Rate zones does not need custom code like you are showing ...
Can you give specific details on what exactly you are trying to do and what code changes you have made and what is working and what is not working?
I am not fully grasping what you mean by:
Quote:
but suddently I realized that no matter what option do the customers select, the next page shows only other expensive selection
Re: Different maximum shipping weights for different shipping modules
Quote:
Originally Posted by
Ajeh
I am not sure what you are doing with the code you posted ...
The Zone Rate zones does not need custom code like you are showing ...
Can you give specific details on what exactly you are trying to do and what code changes you have made and what is working and what is not working?
I am not fully grasping what you mean by:
Thank you Ajeh for quick response....
I was using code.... in zone file
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_PERWEIGHTUNIT_STATUS == 'True') ? true : false);
}
// bof: turn off for weight over 2
if (!IS_ADMIN_FLAG) {
global $cart;
if ($_SESSION['cart']->show_weight() > 2) {
$this->enabled = false;
}
}
// eof: turn off for weight over 2
and it was working perfectly fine for me... (I wanted 2 kg limit for shipping)
I have installed another shipping for bigger orders(expensive) ,
but problem is limited weight shipping does not work properly now...
when customers select limited weight shipping and press next for checkout...total shows with other shipping(expensive)....
I mean it ignores the selection and shows total with another shipping...
I hope I m successful to explain you and you can guide me....
Re: Different maximum shipping weights for different shipping modules
I do not know why you have this code in the Zone Rate zones shipping module:
Code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_PERWEIGHTUNIT_STATUS == 'True') ? true : false);
}
you should have in the Zone Rate zones just the new code in Red:
Code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
}
// bof: turn off for weight over 2
if (!IS_ADMIN_FLAG) {
global $cart;
if ($_SESSION['cart']->show_weight() > 2) {
$this->enabled = false;
}
}
// eof: turn off for weight over 2
// CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
$this->num_zones = 3;