Zen Follower
- Join Date:
- Sep 2012
- Posts:
- 104
- Plugin Contributions:
- 0
Is it possible to disable buying only in one category?
Ajeh:
You have the code in the wrong place ... :eek:
Remove the new code that I gave you:
// bof: show room only for master_categories_id 58
echo 'Products ID: ' . $product_id . ' Master Cat: ' . zen_get_products_category_id($product_id) . '<br>';
if (zen_get_products_category_id($product_id) == 58) {
return '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . TEXT_CALL_FOR_PRICE . '</a>';
}
// eof: show room only for master_categories_id 58
>
> and go lower in the code and find the code that starts with:
> ```
}
$button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
switch (true) {
// cannot be added to the cart
Put it just below the } and above the line starting with $button_check so it reads:
}
// bof: show room only for master_categories_id 58
echo 'Products ID: ' . $product_id . ' Master Cat: ' . zen_get_products_category_id($product_id) . '<br>';
if (zen_get_products_category_id($product_id) == 58) {
return '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . TEXT_CALL_FOR_PRICE . '</a>';
}
// eof: show room only for master_categories_id 58
$button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
switch (true) {
// cannot be added to the cart
It works!!!!
Thanks!!!
I'd have two more questions regarding this issue :
Why does it show this :**Products ID: 133 Master Cat: 58** - How can i make this dissapear or prevent showing this info. in cas of other items later?
In case i'd like to have two or three other categories like this, for showroom only, do i only have to write the other category id's next to this one? Or doe it work differently?
Thanks in advance
Nandor