p.s. here's the code in my closed flat shipping file as I am stumped by it (basing my attempts on Ajeh's reply to another post here: http://www.zen-cart.com/forum/showpo...4&postcount=5:)
PHP Code:
// moderately experimental change by kjt 09.15.2011
global $cart;
// category IDs: 19 (Patterns), 25 Bags, 23 Cardigans, 20 Hats, 26 Mittens, 27 Scarves, 24 Socks, 21 Sweaters, 29 Vests as of 9/15/2011
$chk_cat1 = $_SESSION['cart']->in_cart_check('master_categories_id','20'); // counts how many are of the Hats category
$chk_cat1 += $_SESSION['cart']->in_cart_check('master_categories_id','26'); // counts how many are of the Mittens category
$chk_cat1 += $_SESSION['cart']->in_cart_check('master_categories_id','25'); // counts how many are of the Bags category
$chk_cat1 += $_SESSION['cart']->in_cart_check('master_categories_id','23'); // counts how many are of the Cardgans category
$chk_cat1 += $_SESSION['cart']->in_cart_check('master_categories_id','27'); // counts how many are of the Scarves category
$chk_cat1 += $_SESSION['cart']->in_cart_check('master_categories_id','24'); // counts how many are of the Socks category
$chk_cat1 += $_SESSION['cart']->in_cart_check('master_categories_id','21'); // counts how many are of the Sweaters category
$chk_cat1 += $_SESSION['cart']->in_cart_check('master_categories_id','29'); // counts how many are of the Vests category
$full_cart = $_SESSION['cart']->count_contents(); // counts number of items in the cart in total
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
// also disable if cart contents include not-patterns or too many patterns
if (($chk_cat1 != $full_cart) || ($full_cart > 5)) {
$this->enabled = ((MODULE_SHIPPING_FLATpattUSPri_STATUS == 'True') ? true : false);
}
}
Bookmarks