Forums / Built-in Shipping and Payment Modules / Calculate shipping cost only on certain items

Calculate shipping cost only on certain items

Locked

Views: 730

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
20 Dec 2010, 4:59 PM
#1
mned avatar

mned

New Zenner

Join Date:
Aug 2010
Posts:
3
Plugin Contributions:
0

Calculate shipping cost only on certain items

I've done a lot of searching and can't seem to find anything to help with our issue.

Here's the situation:

  • Most of our products ship at a flat rate when the order is under $100, and have free shipping when the order is over $100.
  • A few of our products require additional shipping charges because of their weight.

We have modified three shipping modules (freeoptions.php, flat.php, and table.php):

  • freeoptions.php activates when the weight is under 3000lbs., and the order total is over $100.
  • flat.php activates when the weight is under 3000lbs., and the order total is under $100.
  • table.php activates when the weight is over 3000lbs., and charges the flat rate + a straight 12% additional shipping cost based on the total price.

The problem - Everything works fine until an overweight product is combined with one that is not. We only want the 12% shipping to apply to the total value of the overweight items, and not to the entire value of the order. However, as soon as the table.php module activates, it applies the shipping cost to the total.

Here is the code modification in table.php

if (MODULE_SHIPPING_TABLE_MODE == 'weight') {
$shipping = 6.95 + ($_SESSION['cart']->show_total() * .12);

Any ideas on how to handle this situation would be greatly appreciated! I'm new to php, so apologize in advance if I've missed any needed information.

Thanks