Also, you need to add for the Admin an IF around the new code:
Code:
if (!IS_ADMIN_FLAG) {
// new code here
}
For checking it is a mixed cart try:
Code:
// bof: only show for mixed cart category 1, 4 and 5 & category 2 and 6
if (!IS_ADMIN_FLAG) {
$chk_cat = 0;
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','1');
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','4');
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','5');
$chk_cat2 = 0;
$chk_cat2 += $_SESSION['cart']->in_cart_check('master_categories_id','2');
$chk_cat2 += $_SESSION['cart']->in_cart_check('master_categories_id','6');
//echo 'Flat sees $chk_cat: ' . $chk_cat . ' $chk_cat2: ' . $chk_cat2 . '<br>';
if ($this->enabled && ($chk_cat > 0 && $chk_cat2 > 0)) {
$this->enabled = true;
} else {
$this->enabled = false;
}
}
// eof: only show for mixed cart category 1, 4 and 5 & category 2 and 6
That echo can be uncommented for testing purposes ...
Bookmarks