So if the Products all use 1 of 3 different master_categories_id and no other Products use those master_categories_id values you could get the count of the Products x quantity in the cart that use master_categories_id 12. 15 or 17 with:
Code:
global $order, $cart;
$chk_cat = 0;
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','12');
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','15');
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','17');
if ($order->delivery['country_id'] == 222) {
$chk_cat_shipping = $chk_cat * 5.00;
} else {
$chk_cat_shipping = $chk_cat * 10.00;
}
Then find the code similar to:
Code:
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_FLAT_TEXT_WAY,
'cost' => MODULE_SHIPPING_FLAT_COST)));
and change it to:
Code:
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_FLAT_TEXT_WAY,
'cost' => MODULE_SHIPPING_FLAT_COST + $chk_cat_shipping)));
That is based on the Flat Rate flat shipping module but can be adapted to any other shipping module ...
Bookmarks