Well blow me down! It seems I was on the right track.
I added
Code:
$chk_oversized += $_SESSION['cart']->in_cart_check_attrib('products_attributes_id', '8');
into Ajeh's code and created this new function in shopping_cart.php
Code:
/* Method to calculate the number of items in a cart based on an attribute property */
function in_cart_check_attrib($check_what, $check_value='1') {
global $db;
// if nothing is in cart return 0
if (!is_array($this->contents)) return 0;
// compute total quantity for field
$in_cart_check_qty=0;
reset($this->contents);
while (list($products_id, ) = each($this->contents)) {
$testing_id = zen_get_prid($products_id);
// check if field it true
$product_check = $db->Execute("select " . $check_what . " as check_it from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . $testing_id . "' limit 1");
if ($product_check->fields['check_it'] == $check_value) {
$in_cart_check_qty += $this->contents[$products_id]['qty'];
}
}
return $in_cart_check_qty;
}
Seems to work fine.