Changed the in_cart_check to accept a comparison variable too. Here is the edit if anyone is interested.
/zen_cart/includes/classes/shopping_cart.php
edit beginning of function to read this
PHP Code:
function in_cart_check($check_what, $check_value='1',[B] $operator = "=="[/B]) {
Then edited further down in the function to handle what I needed it to, for more operators, more cases are needed.
PHP Code:
if($operator != "=="){
switch($operator){
case ">":
if ($product_check->fields['check_it'] > $check_value) {
$in_cart_check_qty += $this->contents[$products_id]['qty'];
}
break;
case "<":
if ($product_check->fields['check_it'] < $check_value) {
$in_cart_check_qty += $this->contents[$products_id]['qty'];
}
break;
}
} else {
if ($product_check->fields['check_it'] == $check_value) {
$in_cart_check_qty += $this->contents[$products_id]['qty'];
}
}
And it needs to replace this
PHP Code:
if ($product_check->fields['check_it'] == $check_value) {
$in_cart_check_qty += $this->contents[$products_id]['qty'];
}
If there is a better way to do this, let me know. Now, I just run the check you suggested, change the operator to greater than, and I'm good to go.
Thanks for the help!
Bookmarks