Forums / General Questions / How to automatically turn off sold out categories

How to automatically turn off sold out categories

Views: 873

Results 1 to 5 of 5
23 Jul 2015, 4:41 PM
#1
joew36 avatar

joew36

New Zenner

Join Date:
Feb 2010
Location:
Vermont, USA
Posts:
21
Plugin Contributions:
0

How to automatically turn off sold out categories

We have a site that liquidates products for others. So, our inventory changes daily and items sell out all the time. Products automatically turn off when sold out, but how would I go about setting up a procedure (chron, php, mysql) to turn off sold out categories?

24 Jul 2015, 1:26 AM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How to automatically turn off sold out categories

joew36:

We have a site that liquidates products for others. So, our inventory changes daily and items sell out all the time. Products automatically turn off when sold out, but how would I go about setting up a procedure (chron, php, mysql) to turn off sold out categories?

Well, I just realized that perhaps this may/may not work for you (ZC 1.3.9) but the following post showed how to do it for a ZC 1.5.4 site. It may still work for 1.3.9. The thread is full of various attempts to obtain the desired goal, but at least it's something.

https://www.zen-cart.com/showthread.php?174342-How-to-hide-categories-with-no-active-products&p=1265047#post1265047

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

24 Jul 2015, 6:33 AM
#3
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: How to automatically turn off sold out categories

mc12345678:

Well, I just realized that perhaps this may/may not work for you (ZC 1.3.9) but the following post showed how to do it for a ZC 1.5.4 site. It may still work for 1.3.9. The thread is full of various attempts to obtain the desired goal, but at least it's something.

https://www.zen-cart.com/showthread.php?174342-How-to-hide-categories-with-no-active-products&p=1265047#post1265047

Don't think it will work since in our case the function

**zen_count_products_in_category()

**is looking for inactive products but not for products which are sold out (stock = 0) but still active.So IMHO one would first need to set a sold out product to inactive.

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

24 Jul 2015, 8:44 AM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: How to automatically turn off sold out categories

joew36:

We have a site that liquidates products for others. So, our inventory changes daily and items sell out all the time. Products automatically turn off when sold out, but how would I go about setting up a procedure (chron, php, mysql) to turn off sold out categories?

frank18:

Don't think it will work since in our case the function

**zen_count_products_in_category()

**is looking for inactive products but not for products which are sold out (stock = 0) but still active.So IMHO one would first need to set a sold out product to inactive.

Bolded above indicates that the products are turned off/inactive, therefore meetiing the rewuirement that is humbly suggested. Unless this additional post is related to a different issue/situation than posted by the OP.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

24 Jul 2015, 12:17 PM
#5
joew36 avatar

joew36

New Zenner

Join Date:
Feb 2010
Location:
Vermont, USA
Posts:
21
Plugin Contributions:
0

Re: How to automatically turn off sold out categories

Thanks, I did not see that when I searched for an answer. I'm actually off for a couple days but will check this out next week. Thanks.