Re: Is it possible to disable buying only in one category?
Without a numeric value to the decimal places the currency breaks ... putting the 0 there fixes this ...
On adding more master_categories_id you could use:
Code:
if (zen_get_products_category_id($product_id) == 58 || zen_get_products_category_id($product_id) == 32 || zen_get_products_category_id($product_id) == 49) {
Re: Is it possible to disable buying only in one category?
Quote:
Originally Posted by
Ajeh
Without a numeric value to the decimal places the currency breaks ... putting the 0 there fixes this ...
On adding more master_categories_id you could use:
Code:
if (zen_get_products_category_id($product_id) == 58 || zen_get_products_category_id($product_id) == 32 || zen_get_products_category_id($product_id) == 49) {
i added one more mastercategory , is this good this way?
// 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 || zen_get_products_category_id($product_id) == 4) {
return '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . TEXT_CALL_FOR_PRICE . '</a>';
}
// eof: show room only for master_categories_id 58
// eof: show room only for master_categories_id 4
No syntax error was displayed, but didnt know whether to add : // eof: show room only for master_categories_id 4
as above
Thanks
Nandor
Re: Is it possible to disable buying only in one category?
That is fine ...
The line:
Code:
// eof: show room only for master_categories_id 4
is just a comment in the code, lines that start with //, are just to remind you what you have changed in the code ...
Re: Is it possible to disable buying only in one category?
NOTE: That master_categories_id of 4 is not ... or should not ... be a Product's master_categories_id ... 4 is a Top Level Category you might want to check that you are using the right categories_id for the master_categories_id ...
Re: Is it possible to disable buying only in one category?
Quote:
Originally Posted by
Ajeh
NOTE: That master_categories_id of 4 is not ... or should not ... be a Product's master_categories_id ... 4 is a Top Level Category you might want to check that you are using the right categories_id for the master_categories_id ...
And how can i change/check these ids?
thanks
Nandor
Re: Is it possible to disable buying only in one category?
Go to your Zen Cart Admin and edit the Product ...
What do you see for:
Product Master Category:
Re: Is it possible to disable buying only in one category?
Quote:
Originally Posted by
Ajeh
Go to your Zen Cart Admin and edit the Product ...
What do you see for:
Product Master Category:
At ID 4 (category ID ) at product i see : Product Master Category: ID# 59 Mugs
I suppose its not good. Now i have to check all of the products/cat. and rewrite the master category?
thanks
Nandor
Re: Is it possible to disable buying only in one category?
ID 4 cannot be a master_categories_id ...
On your site, I see that:
/index.php?main_page=index&cPath=4
holds a Category ...
Categories hold Categories or Products but not both ...
If I go down further, I see:
/index.php?main_page=product_info&cPath=4_59&products_id=134
which tells me there is 1 Product in categories_id 4 which is products_id 134 ... so Product Porcelain Cup with plate is the only Product right now in categories_id 59 and that should have a master_categories_id 59, not 4 ...
Re: Is it possible to disable buying only in one category?
Quote:
Originally Posted by
Ajeh
ID 4 cannot be a master_categories_id ...
On your site, I see that:
/index.php?main_page=index&cPath=4
holds a Category ...
Categories hold Categories or Products but not both ...
If I go down further, I see:
/index.php?main_page=product_info&cPath=4_59&products_id=134
which tells me there is 1 Product in categories_id 4 which is products_id 134 ... so Product Porcelain Cup with plate is the only Product right now in categories_id 59 and that should have a master_categories_id 59, not 4 ...
How/Where can i change master categories?
Re: Is it possible to disable buying only in one category?
Quote:
At ID 4 (category ID ) at product i see : Product Master Category: ID# 59 Mugs
I suppose its not good. Now i have to check all of the products/cat. and rewrite the master category?
If you already see that its master_categories_id is 59, you do not need to change anything but the code:
Code:
if (zen_get_products_category_id($product_id) == 58 || zen_get_products_category_id($product_id) == 59) {
as 59 is the master_categories_id for the Product, not 4 ...