Edit the shipping module:
/includes/modules/shipping/zones.php
You could try this custom code in RED:
Code:
// bof: purchase 5 items, it would be 2 shipping charges. 7 items still 2 shipping charges, 9 items would be three shipping charges.
$chk_products_id = 180; // products_id of product to charge special charge
$extra_charges = 12.00; // charge for each extra charge group
$chk_product_quantity = $_SESSION['cart']->get_quantity($chk_products_id);
switch (true) {
case ($chk_product_quantity < 5):
$extra_shipping = $extra_charges;
break;
case ($chk_product_quantity <= 7):
$extra_shipping = $extra_charges * 2;
break;
case ($chk_product_quantity <= 9):
$extra_shipping = $extra_charges * 3;
break;
default:
$extra_shipping = 0.00; // nothing set for 5, 7 or 9 so no charge
break;
}
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => $shipping_method,
'cost' => $shipping_cost + $extra_shipping)));
// eof: purchase 5 items, it would be 2 shipping charges. 7 items still 2 shipping charges, 9 items would be three shipping charges.
Set the settings on:
$chk_products_id <-- your products_id number
$extra_charges <-- amount you want to charge per group
Change the settings in your Zone Rates zones shipping module to:
Zone 1 0:0.00;20:25.00
Zone 2 0:0.00;20:55.00
Zone 3 0:0.00;20:105.00
Be aware on order weights over 20lbs, your settings will have no charges and the shipping will calculate to $0.00 ...
If you always want to have those charges, change 20 to a high value such as 10000 ...
In the Configuration ... Shipping/Packaging ... make sure that you have set the two Tare Rates to 0:0 so that they do not add more weight ...
Set to 0 the settings for:
Order Free Shipping 0 Weight Status
If there is no weight to the order, does the order have Free Shipping?
0= no
1= yes
Note: When using Free Shipping, Enable the Free Shipping Module this will only show when shipping is free.
See if that works for you ...
Be aware that the settings you wanted for the extra charges for the special Product only covers to quantity 9, if someone adds quantity 10, it will calculate $0.00 on the extra charges ...
Bookmarks