This is a long version of how to test the qty for Always Free Shipping that is in the cart to disable the flat.php shipping module:
Code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
}
// test contents for Cases
global $cart;
$skip_free = false;
$chk_case = 0;
if (IS_ADMIN_FLAG == false) {
$chk_case = $_SESSION['cart']->in_cart_check('product_is_always_free_shipping', 1);
if ($chk_case > 0) {
$skip_free = true;
}
}
//echo 'Qty Always Free Shipping: ' . $chk_case . '<br>';
// disable for 1 or more Always Free Shipping in cart
if ((IS_ADMIN_FLAG == false && $skip_free)) {
$this->enabled = false;
}
You can use this to enable or disable modules based on the results ...
Bookmarks