You could check the cart and calculate the extra charge adding the code in RED:
/includes/modules/shipping/table.php
Code:
// 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;
$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' => $extra_charge + $shipping + (MODULE_SHIPPING_TABLE_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_TABLE_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_TABLE_HANDLING) ) ));
// eof: Add extra charge for heavy items in cart
if ($this->tax_class > 0) {
Just set the products_id on the lines for:
Code:
$chk_cart += $_SESSION['cart']->in_cart_check('products_id','12');
and change the number example 12 to what ever products_id you need ... for additional products just continue to add additional lines of:
Code:
$chk_cart += $_SESSION['cart']->in_cart_check('products_id','12');
Then, set the amount to charge per item where 1.00 is the charge I put in:
Code:
$extra_charge = $chk_cart * 1.00;
Bookmarks