Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Finished - Addon To Hide Empty Categories Rate Topic   * * * - - 1 votes

 
  • brandonvd
  • is Super Awesome
  • Members
  • Join Date: 19-Dec 06
  • 2629 posts

Posted 26 January 2011 - 03:30 PM #1

Well, I had tbirnseth create a mod for me that would filter out empty categories.

I turned it into its own addon and figured I'd share it on here.

Basically it filters out any categories that match this criteria:

Categories containing products of status 'D' or 'H' and have an inventory <= 0 (values are product counts of qualifying products)

That last part was tbirnseth's words.

This addon doesn't change the status of a category, it just filters it out so the customers can't see it. Kind of a long story about why it doesn't change the status, but tbirnseth was right in making this way and pointed out some great reasons.

Installation is really easy.

1.) Move the hide_categories addon into your addons folder
2.) Go to Admin => Administration => Addons => Install the Hide Categories addon
3.) Clear you cache
4.) It is installed

To use the addon:

1.) Go to Admin => Catalog => Click on the link circled in blue:
Posted Image

2.) You'll end up with a list of categories that are filtered out like:

Posted Image

3.) That's it. Now you customers can't see those categories.

If you add products or make products active that are in those categories, just run the Compress Categories link again and it will unhide them.

I'll mainly use this after I do product imports, but I'm sure other people can use it for different things.

One thing though. This addon is more advanced than what I am capable of doing so I can't really guarantee any kind of support. I'm sure tbirnseth will support this, but since it isn't an addon that he is releasing, I doubt he'll support it for free.

Anyways, there you go. Hopefully someone here can use this.

Brandon

Ps. I can't remember what version this is for, but I know it isn't compatible with 3.x.

Attached Files



 
  • creativeuser
  • Senior Member
  • Members
  • Join Date: 20-May 09
  • 150 posts

Posted 26 January 2011 - 04:33 PM #2

Thanks a lot, i'm testing it,it's wonderful :)
all is oki !

Very good job !

 
  • vidan
  • Senior Member
  • Members
  • Join Date: 11-Jan 10
  • 373 posts

Posted 11 February 2011 - 05:55 AM #3

brandon, thanks for sharing :)

 
  • KarolosGIM
  • Junior Member
  • Authorized Reseller
  • Join Date: 25-Oct 10
  • 1 posts

Posted 17 July 2011 - 03:09 PM #4

I'm using the last version of cs-cart and after I run your add-on in the admin pages this error shows up: "Bad category_id 0 "

Empty categories are not removed, instead non-empty catehories are (in a random pattern).

Any ideas?

 
  • brandonvd
  • is Super Awesome
  • Members
  • Join Date: 19-Dec 06
  • 2629 posts

Posted 17 July 2011 - 04:18 PM #5

I haven't switched any of my stores that have this addon to version 2.2.1 yet so I have no clue what would be wrong. Honestly, I probably wouldn't have a clue anyways since this type of thing is beyond my knowledge, which is why I hired Tony.

I'll contact Tony and see what he says. He is very good at keeping his addons updated on the subversion level, but this is a brand new version so he'll probably want to charge. I'll see how much he wants. If it is within my current budget, I'll just pay it and post the updated version on here. If it is outside of my budget, would you be willing to pitch in a few bucks?

Thanks,

Brandon

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10842 posts

Posted 17 July 2011 - 06:31 PM #6

Brandon,
I don't seem to have a copy of this around. If you want to send me the archive, I can look for the error and see what's up. My guess is that there's some config problem in the merchant's store where a category does not exist where something in the store (like the product_categories table) thinks it should exist.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • brandonvd
  • is Super Awesome
  • Members
  • Join Date: 19-Dec 06
  • 2629 posts

Posted 17 July 2011 - 07:00 PM #7

Well Tony of course came up with a solution and I didn't even have to ask. Pretty darn cool.

I've attached a V2 of the Hide Categories Addon. This should work with 2.1.4 or 2.2.1.

I hope it helps. And don't forget to thank Tony.

Thanks,

Brandon

Attached Files



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10842 posts

Posted 17 July 2011 - 07:43 PM #8

Note that the change had nothing to do with the version. The issue is that the merchant has a bad category entry (category_id = 0) in their product_categories table and a category with that ID does not exist. I simply skip categories with category_id == 0....

Note that Brandon has the archive built in a way that you will need to extract and copy files versus simply extracting into the root of your store.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • brandonvd
  • is Super Awesome
  • Members
  • Join Date: 19-Dec 06
  • 2629 posts

Posted 17 July 2011 - 07:51 PM #9

I just updated the file so that it should be able to just be uploaded and un-compressed.

Tony, does it look right now?

Thanks,

Brandon

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 10842 posts

Posted 17 July 2011 - 09:46 PM #10

Yep, everything is now relative to the root directory of a store.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 

Posted 05 October 2011 - 04:15 AM #11

Doesn't appear to be working for 2.2.1? (I downloaded the zip file from: 18 July 2011 - 06:00 AM)

After running, and a page or two of category names with green background is displayed, I viewed the home page, and still can see categories that are empty - and sub-categories within those which are also empty.

It doesn't appear to have hidden anything.

And where is this file people are talking about? When you run this, does it create some sort of log or backup?

Thanks for everyones help!
Cheers!

Thank you!


 
  • Flow
  • Super Duper and Amazingly Sexy Senior
  • Members
  • Join Date: 13-Oct 10
  • 2150 posts

Posted 05 October 2011 - 06:34 AM #12

Doesn't appear to be working for 2.2.1? (I downloaded the zip file from: 18 July 2011 - 06:00 AM)

After running, and a page or two of category names with green background is displayed, I viewed the home page, and still can see categories that are empty - and sub-categories within those which are also empty.

It doesn't appear to have hidden anything.

And where is this file people are talking about? When you run this, does it create some sort of log or backup?

Thanks for everyones help!
Cheers!


Did you clear your cache?

When life hands you lemons, bring on the Tequila baby!


 

Posted 06 October 2011 - 05:52 AM #13

Yes, of course :P

If there are 15 sub-categories, with 10 sub-categories with products within, and 200 products. This addon, in my case, will show only 2 sub-categories, but will show all 200 products!

It does not take in to account SECONDARY CATEGORIES! (It appears to me...)
Or there is some other major loop hole in the logic :(

Would appreciate an update! :)

Client has Professional licence. Will test with client on Multi-Vendor, i hope they haven't updated yet to 2.2.2/2.2.3.

Thanks!

Thank you!


 
  • otherjohn
  • Junior Member
  • Members
  • Join Date: 21-Apr 11
  • 21 posts

Posted 20 October 2011 - 01:26 PM #14

I can confirm, this is the same problem we are having. It doesn't hide sub-categories with no products in them.

Yes, of course :P

If there are 15 sub-categories, with 10 sub-categories with products within, and 200 products. This addon, in my case, will show only 2 sub-categories, but will show all 200 products!

It does not take in to account SECONDARY CATEGORIES! (It appears to me...)
Or there is some other major loop hole in the logic :(

Would appreciate an update! :)

Client has Professional licence. Will test with client on Multi-Vendor, i hope they haven't updated yet to 2.2.2/2.2.3.

Thanks!



 

Posted 25 October 2011 - 02:12 AM #15

Yes, I suspected as much. I was unable to test the add-on elsewhere, as everything is 2.2.3.

I wish there was a way to add a delay to the standard/default menu's in CS-Cart. (Categories)
As if you just go off the edge by a mm, the entire menu collapses, and disappears.

Would be great if we could combine this HIDE EMPTY CATEGORIES (and Sub-sub-sub-sub-categories) and make the Categories menu more user friendly by keeping the menu expanded... for a 500ms or 800ms delay...


Thank you!


 
  • iconist
  • Newbie
  • Members
  • Join Date: 07-Aug 11
  • 4 posts

Posted 10 January 2012 - 03:00 PM #16

hi, is it possible to get the add-on to automatically hide empty categories AND to automatically unhide them?
in our case we have a multivendor platform and we cannot manually unhide former empty categories when a vendor puts the first product in it...

 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3190 posts

Posted 11 January 2012 - 03:48 PM #17

Addon to hide sold product after set period of time would be greatly apreciated :) just idea for next project..

 

Posted 21 August 2012 - 06:45 AM #18

I've tried this add-on a few times now, but each time all sorts of problems occur, categories etc. Sub-categories are still missed. Thank god everything is reverted when uninstalled.

Are there any planned updates Brandon? Or perhaps a $5 version which has been completed and tested in version 3.x?

Although, I'm sure I've seen another add-on that is available that does the same thing - hide empty categories, or is it just another of Brandons'? :confused:


So I guess these are the only two versions?

Attached File  CS-Cart v2.x - Hide Empty Categories v1 (brandonvd) 2011.01.26.zip   5.19KB   9 downloads

Attached File  CS-Cart v2.x - Hide Empty Categories v2 (brandonvd) 2011.07.17.zip   6KB   27 downloads
> Updated ../func.php

Thank you!


 
  • BaDTaG
  • Senior Member
  • Members
  • Join Date: 01-Jul 11
  • 188 posts

Posted 27 September 2012 - 07:12 PM #19

any of you know if this works under csc 3.0.2 ??
VPS Hosting whit easy VPS control panel no technical skills required.
EDB Eksperten din online it forhandler

 
  • brandonvd
  • is Super Awesome
  • Members
  • Join Date: 19-Dec 06
  • 2629 posts

Posted 29 September 2012 - 04:03 AM #20

No, I have no plans to update this addon. If anyone is interested, tbirnseth (Tony) created this addon for me, so if you want it updated, I'd recommend contacting him.

I no longer have use of this addon, so I don't need it upgraded and don't want to pay to upgrade it, sorry.

Thanks,

Brandon