
Originally Posted by
Ajeh
PHP Code:
// disable for one master_categories_id
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','17') > 0)) {
$this->enabled = false;
}
Ajeh, I have this logic working on my site in flat.php and a clone of flat called flathalf.php, but with every new category I add, I have to add a new test 'if' statement to these files. To this point:
PHP Code:
// disable for one master_categories_id for WOTM Full Year
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','72') > 0)) {
$this->enabled = false;
}
// disable for one master_categories_id for Dealer's Choice
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','67') > 0)) {
$this->enabled = false;
}
// disable for one master_categories_id for Wine Baskets
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','68') > 0)) {
$this->enabled = false;
}
// disable for one master_categories_id for Thirst-Aid Kits
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','69') > 0)) {
$this->enabled = false;
}
// disable for one master_categories_id for Personalized Labels
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','70') > 0)) {
$this->enabled = false;
}
// disable for one master_categories_id for Accessories
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','74') > 0)) {
$this->enabled = false;
}
// disable for one master_categories_id for Wine Glasses
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','75') > 0)) {
$this->enabled = false;
}
// disable for one master_categories_id for Wine Openers
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','76') > 0)) {
$this->enabled = false;
}
// disable for one master_categories_id for Backpacks and Totes
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','77') > 0)) {
$this->enabled = false;
}
// disable for one master_categories_id for Journals and Books
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','78') > 0)) {
$this->enabled = false;
}
// disable for one master_categories_id for Wine Racks
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','79') > 0)) {
$this->enabled = false;
}
// disable for one master_categories_id for Accessories->Miscellaneous
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','80') > 0)) {
$this->enabled = false;
}
// disable for one master_categories_id for Featured Wines
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','99') > 0)) {
$this->enabled = false;
}
For me, flat and flathalf are each for one category only, so can I reverse this logic somehow so this tests for a category and enable the module?
I'm pretty good with php, but I am paranoid of breaking things on a live store!
Thanks so much!
Bookmarks