Forums / Managing Customers and Orders / Is it possible to disable buying only in one category?

Is it possible to disable buying only in one category?

Views: 5,239

Results 41 to 52 of 52
9 Apr 2013, 3:18 PM
#41
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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:

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) {

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Apr 2013, 4:33 PM
#42
nandor avatar

nandor

Zen Follower

Join Date:
Sep 2012
Posts:
104
Plugin Contributions:
0

Re: Is it possible to disable buying only in one category?

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:

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
9 Apr 2013, 4:42 PM
#43
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Is it possible to disable buying only in one category?

That is fine ...

The line:

// 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 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Apr 2013, 4:44 PM
#44
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Apr 2013, 4:53 PM
#45
nandor avatar

nandor

Zen Follower

Join Date:
Sep 2012
Posts:
104
Plugin Contributions:
0

Re: Is it possible to disable buying only in one category?

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

9 Apr 2013, 4:56 PM
#46
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Apr 2013, 5:09 PM
#47
nandor avatar

nandor

Zen Follower

Join Date:
Sep 2012
Posts:
104
Plugin Contributions:
0

Re: Is it possible to disable buying only in one category?

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

9 Apr 2013, 5:20 PM
#48
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Apr 2013, 5:23 PM
#49
nandor avatar

nandor

Zen Follower

Join Date:
Sep 2012
Posts:
104
Plugin Contributions:
0

Re: Is it possible to disable buying only in one category?

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?

9 Apr 2013, 5:25 PM
#50
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Is it possible to disable buying only in one 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?

If you already see that its master_categories_id is 59, you do not need to change anything but the code:

if (zen_get_products_category_id($product_id) == 58 || zen_get_products_category_id($product_id) == [B]59[/B]) {

as 59 is the master_categories_id for the Product, not 4 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Apr 2013, 5:41 PM
#51
nandor avatar

nandor

Zen Follower

Join Date:
Sep 2012
Posts:
104
Plugin Contributions:
0

Re: Is it possible to disable buying only in one category?

Ajeh:

If you already see that its master_categories_id is 59, you do not need to change anything but the code:

if (zen_get_products_category_id($product_id) == 58 || zen_get_products_category_id($product_id) == [B]59[/B]) {

> 
> as **59** is the master_categories_id for the Product, not **4** ...


**It works perfectly!!!!

thanks Ajeh!!!!!**
9 Apr 2013, 5:56 PM
#52
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Is it possible to disable buying only in one category?

You are most welcome ... glad that this is working ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!