You could customize the Flat Rate flat shipping module ...
Code:
function quote($method = '') {
global $order;
// bof: custom Flat rates
global $cart;
// check how many cart contains of products_id 6
$chk_item1 = 0;
$chk_item1 += $_SESSION['cart']->in_cart_check('products_id','6');
// check how many cart contains of products_id 18
$chk_item2 = 0;
$chk_item2 += $_SESSION['cart']->in_cart_check('products_id','18');
// check total count
$chk_cart_count = $_SESSION['cart']->count_contents();
// set rate based on total items in cart vs products_id 6, products_id 18 vs all products
switch (true) {
case ($chk_item1 == $chk_cart_count):
// only Item1 is in the cart
$flat_charge = 1.00;
break;
case ($chk_item2 == $chk_cart_count):
// only Item2 is in the cart
$flat_charge = 1.00;
break;
default:
// mixed cart
$flat_charge = MODULE_SHIPPING_FLAT_COST;
break;
}
$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' => $flat_charge)));
// eof: custom Flat rates
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
NOTE: Set the Flat Rate Fee to 2.00 on the module ...
Bookmarks