See if this works for you to customize the Table Rate table shipping module:
/includes/modules/shipping/table.php
Code:
// bof: add $5.00 if products_id 10 or 12 are in the cart add $7.00 if products_id 112 or 117 are in the cart
global $cart;
$chk_products = $_SESSION['cart']->get_product_id_list();
$chk_products_array = preg_split("/[,]/" , $chk_products);
echo print_r($chk_products_array);
for($i=0; $i<sizeof($chk_products_array); $i++) {
// add additional $5.00 if any of these are in the cart
if (in_array($chk_products_array[$i], array('10', '12'))) {
$add_extra_base = 5.00;
}
// add additional $7.00 if any of these are in the cart
if (in_array($chk_products_array[$i], array('112', '117'))) {
$add_extra_base2 = 7.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' => $add_extra_base + $add_extra_base2 + $shipping + (MODULE_SHIPPING_TABLE_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_TABLE_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_TABLE_HANDLING) ) ));
// eof: add $5.00 if products_id 10 or 12 are in the cart add $7.00 if products_id 112 or 117 are in the cart
Bookmarks