Forums / Setting Up Categories, Products, Attributes / How to hide categories with no active products?

How to hide categories with no active products?

Views: 26,152

Results 61 to 80 of 83
27 Jan 2017, 8:26 AM
#61
wolfderby avatar

wolfderby

Zen Follower

Join Date:
Dec 2008
Location:
Pittsburgh, PA
Posts:
241
Plugin Contributions:
0

How to hide categories with no active products?

Has anyone had success w/ this one 1.5.5? I can't seem to get it to work for me...

28 Jan 2017, 4:37 PM
#62
mikeel100 avatar

mikeel100

Zen Follower

Join Date:
Sep 2012
Location:
West Jefferson, NC
Posts:
391
Plugin Contributions:
0

Re: How to hide categories with no active products?

Yes it works in 1.5.5d...which mod are you having trouble with? Category Tabs? Subcategories? Sideboxes?

28 Jan 2017, 5:18 PM
#63
mikeel100 avatar

mikeel100

Zen Follower

Join Date:
Sep 2012
Location:
West Jefferson, NC
Posts:
391
Plugin Contributions:
0

Re: How to hide categories with no active products?

wolfderby:

Has anyone had success w/ this one 1.5.5? I can't seem to get it to work for me...

Ignore all the code changes except for those on page 5 of this thread...much of it was experimental until we nailed it down.

I just verified that the changes are working in my live shop...1.5.5d. The site map, horizontal menu (css dropdown on my website), and center box subcategories are working. I do not use the sidebox menu, so, let me know if you are using it and I'll open up my test shop to help if needed.

Did you add the option to your admin table layout settings and set it to the correct value?

28 Jan 2017, 7:44 PM
#64
wolfderby avatar

wolfderby

Zen Follower

Join Date:
Dec 2008
Location:
Pittsburgh, PA
Posts:
241
Plugin Contributions:
0

Re: How to hide categories with no active products?

mikeel100:

Ignore all the code changes except for those on page 5 of this thread...much of it was experimental until we nailed it down.

I just verified that the changes are working in my live shop...1.5.5d. The site map, horizontal menu (css dropdown on my website), and center box subcategories are working. I do not use the sidebox menu, so, let me know if you are using it and I'll open up my test shop to help if needed.

Did you add the option to your admin table layout settings and set it to the correct value?

Yeah I added the option and set it. I was eager to go live w/ the westminster new template, so I'm setting up a /test site now to experiment w/ it more on the classic template. I switched it late at night to see if the template was the cause, and it didn't seem to be the cause of it not working. I struggled to bring my site up to 1.5.5d from 1.3.9 recently, so it's probably something I did.

29 Jan 2017, 5:37 PM
#65
mikeel100 avatar

mikeel100

Zen Follower

Join Date:
Sep 2012
Location:
West Jefferson, NC
Posts:
391
Plugin Contributions:
0

Re: How to hide categories with no active products?

I feel your pain...took me a while to upgrade as well. I tried Westminster a couple of years ago and had to abandon it.

Be careful with the responsive templates...I'm having an awful time with page load speeds when I use the default install in 1.5.5d. The layout is okay but I do not like the performance.

It sounds like you are on the right path. I probably don't need to say this but...after you fresh install your test shop and before installing any other mods, I recommend you copy the classic files to your template system and modify the appropriate files with the suggestions on page 5 of this feed and test them first.

Good luck.

29 Jan 2017, 7:34 PM
#66
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,114
Plugin Contributions:
56

Re: How to hide categories with no active products?

mikeel100:

I feel your pain...took me a while to upgrade as well. I tried Westminster a couple of years ago and had to abandon it.

Be careful with the responsive templates...I'm having an awful time with page load speeds when I use the default install in 1.5.5d. The layout is okay but I do not like the performance.

It sounds like you are on the right path. I probably don't need to say this but...after you fresh install your test shop and before installing any other mods, I recommend you copy the classic files to your template system and modify the appropriate files with the suggestions on page 5 of this feed and test them first.

Good luck.
There's a plugin (Clone a Template) that will help! Just "clone" the *classic *template.

30 Jan 2017, 4:32 PM
#67
mikeel100 avatar

mikeel100

Zen Follower

Join Date:
Sep 2012
Location:
West Jefferson, NC
Posts:
391
Plugin Contributions:
0

Re: How to hide categories with no active products?

lat9:

There's a plugin (Clone a Template) that will help! Just "clone" the *classic *template.

Thanks for the tip. The link is not working.

30 Jan 2017, 5:19 PM
#68
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,114
Plugin Contributions:
56

Re: How to hide categories with no active products?

mikeel100:

Thanks for the tip. The link is not working.
That's weird, it worked for me just now.

31 Jan 2017, 1:52 AM
#69
mikeel100 avatar

mikeel100

Zen Follower

Join Date:
Sep 2012
Location:
West Jefferson, NC
Posts:
391
Plugin Contributions:
0

Re: How to hide categories with no active products?

lat9:

That's weird, it worked for me just now.
It is not working with Chrome in my Samsung Android tablet.

I don't know why.

A new tab opens with this "https://www.zen-cart.com/downloads.php?do=file&id=2087" in the address bar but the page never opens???

31 Jan 2017, 4:06 AM
#70
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,970
Plugin Contributions:
8

Re: How to hide categories with no active products?

mikeel100:

I feel your pain...took me a while to upgrade as well. I tried Westminster a couple of years ago and had to abandon it.

Be careful with the responsive templates...I'm having an awful time with page load speeds when I use the default install in 1.5.5d. The layout is okay but I do not like the performance.

It sounds like you are on the right path. I probably don't need to say this but...after you fresh install your test shop and before installing any other mods, I recommend you copy the classic files to your template system and modify the appropriate files with the suggestions on page 5 of this feed and test them first.

Good luck.

i am not sure why a responsive design template would in fact be slower.... other than the template itself might be poorly coded.... but a responsive design template per se, in my experience, does not slow a site down...

page speed, y-slow and the like are all fine.... they can point you to elements that can make your site faster..... and caching resources definitely helps with a responsive template (or any template for that matter), but...

https://www.webpagetest.org/

really tells a better story (thanks to @rodg)....

in my experience, ZC can slow down due to database lookups, and hosting on fast servers makes a big difference....

and when i say a fast server, i mean a server with SSD drives including hosting of of your database. big difference IMHO....

if you can ssh to your server, you can test the speed of your drives. you are looking for under 1 second when you run the following code:

time for i in `seq 1 1000`; do
    dd bs=4k if=/dev/sda count=1 skip=$(( $RANDOM * 128 )) >/dev/null 2>&1;
done;

and if your disks respond with under 1 second, ensure that your db is hosted on the same server. i have had some shared hosts where they claimed SSD drives, only to host the db on a separate server using HDD.

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

31 Jan 2017, 7:28 PM
#71
mikeel100 avatar

mikeel100

Zen Follower

Join Date:
Sep 2012
Location:
West Jefferson, NC
Posts:
391
Plugin Contributions:
0

Re: How to hide categories with no active products?

carlwhat:

i am not sure why a responsive design template would in fact be slower.... other than the template itself might be poorly coded.... but a responsive design template per se, in my experience, does not slow a site down...

page speed, y-slow and the like are all fine.... they can point you to elements that can make your site faster..... and caching resources definitely helps with a responsive template (or any template for that matter), but...

https://www.webpagetest.org/

really tells a better story (thanks to @rodg)....

in my experience, ZC can slow down due to database lookups, and hosting on fast servers makes a big difference....

and when i say a fast server, i mean a server with SSD drives including hosting of of your database. big difference IMHO....

if you can ssh to your server, you can test the speed of your drives. you are looking for under 1 second when you run the following code:

time for i in seq 1 1000; do
dd bs=4k if=/dev/sda count=1 skip=$(( $RANDOM * 128 )) >/dev/null 2>&1;
done;the

> 
> and if your disks respond with under 1 second, ensure that your db is hosted on the same server.  i have had some shared hosts where they claimed SSD drives, only to host the db on a separate server using HDD.
> 
> best.

Off topic for this thread...but I appreciate the input. 

My DB is on the same drive, speed is okay, and I use db cache already...not sure what is happening.

All I know is that when I turn on responsive in every version of ZC since 1.5.0, my page load speeds are unacceptable (4-5 times slower with GoDaddy and Inmotion Hosting). 

So, it is, in fact, slower for me. I have reported this in another forum and if I figure out why it is happening, I will update in that forum.

My images are off site, so I thought something in the CSS might be causing it. <https://www.webpagetest.org/> verifies the image loads are the issue, but only in Responsive. Images and pages load very fast in Classic...which tells me the problem is with Responsive.

Maybe it will not be an issue when Bootstrap is introduced in 1.6. I'll live with Classic for now.

Thanks.
3 Feb 2017, 7:52 PM
#72
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,853
Plugin Contributions:
18

Re: How to hide categories with no active products?

mikeel100:

My images are off site, so I thought something in the CSS might be causing it.
Seriously?
Your images are someplace other than your images folder?
Putting them where they belong would certainly be the first way to fix image slowness. Don't know what you have with the responsive but, any image caching would certainly be hampered by having to go offsite for every request. Not to mention problems in https mode.:dontgetit

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

5 Feb 2017, 2:39 AM
#73
mikeel100 avatar

mikeel100

Zen Follower

Join Date:
Sep 2012
Location:
West Jefferson, NC
Posts:
391
Plugin Contributions:
0

Re: How to hide categories with no active products?

dbltoe:

Seriously?
Your images are someplace other than your images folder?
Putting them where they belong would certainly be the first way to fix image slowness. Don't know what you have with the responsive but, any image caching would certainly be hampered by having to go offsite for every request. Not to mention problems in https mode.:dontgetit

What is the subject of this thread-- " How to hide categories with no active products?"

This discussion shouldn't even be happening here...and I did mention that in the previous post. Please stop responding in this thread unless it has to do with the subject of this thread:-)

Speed is not an issue in Classic...even with the images off site. Believe me, I know all about image optimization. I was reluctant to use off-site images but it works fine in Classic...and there are no cache, speed, or https issues. Again, Classic works great but Responsive does not.

5 Feb 2017, 4:43 PM
#74
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,853
Plugin Contributions:
18

Re: How to hide categories with no active products?

I won't mention what I thought of responding but, I would like to point out that you made a blanket comment in post #65 that could affect many folk's decisions on templates.

Be careful with the responsive templates...I'm having an awful time with page load speeds when I use the default install in 1.5.5d. The layout is okay but I do not like the performance.Like lat9, we have somewhat of an interest in helping with responsive templates. Your comment sent me straight to test sites to see what could be the cause UNTIL... I saw your offsite images comment.

Non-standard practices WILL have an adverse effect on Zen Cart performance. Other things like old mods, wrong PHP, etc. as well. That's why the posting tips are so important. One of those posting tip questions is "In what ways is your site customized or different from a brand new uncustomized install?"

Your statement (without clarification that yours was not a standard install) could very well cause someone to make an unwise decision in template selection or image placement. You might be able to handle it well but, are you willing to tell others that they could do it as well? Speed is not the only concern when images are off site.

The posting tips are there because we are never "in the same boat." Once one letter; one bit of code; one div call is changed, it becomes your cart unlike any other. Always a similar situation but never the same.
I will comment whenever I feel there is something a budding Zenner needs to know, regardless of the topic. Hopefully, it being found on a Google or forum search will help someone in the future.
That's why I'm here.
you?

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

6 Feb 2017, 7:09 AM
#75
mikeel100 avatar

mikeel100

Zen Follower

Join Date:
Sep 2012
Location:
West Jefferson, NC
Posts:
391
Plugin Contributions:
0

Re: How to hide categories with no active products?

dbltoe:

I won't mention what I thought of responding but, I would like to point out that you made a blanket comment in post #65 that could affect many folk's decisions on templates.
Like lat9, we have somewhat of an interest in helping with responsive templates. Your comment sent me straight to test sites to see what could be the cause UNTIL... I saw your offsite images comment.

Non-standard practices WILL have an adverse effect on Zen Cart performance. Other things like old mods, wrong PHP, etc. as well. That's why the posting tips are so important. One of those posting tip questions is "In what ways is your site customized or different from a brand new uncustomized install?"

Your statement (without clarification that yours was not a standard install) could very well cause someone to make an unwise decision in template selection or image placement. You might be able to handle it well but, are you willing to tell others that they could do it as well? Speed is not the only concern when images are off site.

The posting tips are there because we are never "in the same boat." Once one letter; one bit of code; one div call is changed, it becomes your cart unlike any other. Always a similar situation but never the same.
I will comment whenever I feel there is something a budding Zenner needs to know, regardless of the topic. Hopefully, it being found on a Google or forum search will help someone in the future.
That's why I'm here.
you?

I did not mean to be abrasive in my post. I've been hammered a couple of times by the Good Doctor for having off topic conversations...just trying to prevent it from happening again.

I do appreciate your insight.

Let's end the discussion on Responsive Classic speed in this topic.

Later:-)

16 Mar 2017, 7:30 PM
#76
wolfderby avatar

wolfderby

Zen Follower

Join Date:
Dec 2008
Location:
Pittsburgh, PA
Posts:
241
Plugin Contributions:
0

Re: How to hide categories with no active products?

mikeel100:

I feel your pain...took me a while to upgrade as well. I tried Westminster a couple of years ago and had to abandon it.

Be careful with the responsive templates...I'm having an awful time with page load speeds when I use the default install in 1.5.5d. The layout is okay but I do not like the performance.

It sounds like you are on the right path. I probably don't need to say this but...after you fresh install your test shop and before installing any other mods, I recommend you copy the classic files to your template system and modify the appropriate files with the suggestions on page 5 of this feed and test them first.

Good luck.

thanks for the advice, I followed it and realized I must have been trying to make these mods too late at night haha.

2 Sep 2018, 3:36 AM
#77
net3431 avatar

net3431

New Zenner

Join Date:
Dec 2008
Location:
Phoenix, AZ
Posts:
28
Plugin Contributions:
0

Re: How to hide categories with no active products?

This does not create a switch in layout:

Ajeh:

Then add the switch to the configuration table via the Tools ... Install SQL Patches ...

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Categories with Inactive Products Status', 'CATEGORIES_PRODUCTS_INACTIVE_HIDE', '0', 'Hide Categories with Inactive Products?<br />0= off<br />1= on', 19, 30, 'zen_cfg_select_option(array('0', '1'), ', now());

> 
> Setting this new setting in the Configuration ... Layout Settings ... for Categories with Inactive Products Status to 0 or OFF will NOT hide the empty Categories or Categories with all Products set to products_status = 0 and setting this to 1 or ON will hide them ...
2 Sep 2018, 7:15 AM
#78
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: How to hide categories with no active products?

net3431:

This does not create a switch in layout:
When you access your admin and select configuration->Layout Settings, what does the rest of your uri show after configuration.php ?

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

5 Sep 2018, 12:48 AM
#79
net3431 avatar

net3431

New Zenner

Join Date:
Dec 2008
Location:
Phoenix, AZ
Posts:
28
Plugin Contributions:
0

Re: How to hide categories with no active products?

configuration.php?gID=19

5 Sep 2018, 12:52 AM
#80
net3431 avatar

net3431

New Zenner

Join Date:
Dec 2008
Location:
Phoenix, AZ
Posts:
28
Plugin Contributions:
0

Re: How to hide categories with no active products?

Son of gun... it's there now.

Categories with Inactive Products Status
Edit

Hide Categories with Inactive Products?
0= off
1= on