You could check the cart and calculate the extra charge adding the code in RED:
/includes/modules/shipping/table.php
[B]// bof: Add extra charge for heavy items in cart
$chk_cart = 0;
$chk_cart += $_SESSION['cart']->in_cart_check('products_id','57');
$chk_cart += $_SESSION['cart']->in_cart_check('products_id','112');
$chk_cart += $_SESSION['cart']->in_cart_check('products_id','10');
$chk_cart += $_SESSION['cart']->in_cart_check('products_id','12');
$extra_charge = $chk_cart * 1.00;
[/B]
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE . $show_box_weight,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_TABLE_TEXT_WAY,
'cost' => [B]$extra_charge + [/B]$shipping + (MODULE_SHIPPING_TABLE_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_TABLE_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_TABLE_HANDLING) ) ));
[B]// eof: Add extra charge for heavy items in cart
[/B]
if ($this->tax_class > 0) {
Just set the products_id on the lines for:
[B]$chk_cart += $_SESSION['cart']->in_cart_check('products_id','12');[/B]
and change the number example 12 to what ever products_id you need ... for additional products just continue to add additional lines of:
[B]$chk_cart += $_SESSION['cart']->in_cart_check('products_id','12');[/B]
Then, set the amount to charge per item where 1.00 is the charge I put in:
[B]$extra_charge = $chk_cart * 1.00;
[/B]
Linda McGrath
If you have to think ... you haven't been zenned ...
**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!