What you need to do is compare the number of Items in the cart and see if the total number of Items is the same as the number of Items from your specific Category ...
Assuming that they use the same master_categories_id, in this example categories_id 10, you can do this with the following code in RED:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_USPS_STATUS == 'True') ? true : false);
}
// bof: only show if all Products are from master_categories_id 10
if (!IS_ADMIN_FLAG) {
global $cart;
$chk_category_count = 0;
$chk_category_count += $_SESSION['cart']->in_cart_check('master_categories_id','10');
}
if ($_SESSION['cart']->count_contents() != $chk_category_count) {
$this->enabled = false;
}
// eof: only show if all Products are from master_categories_id 10
if ($this->enabled) {
Linda McGrath
If you have to think ... you haven't been zenned ...
**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!