Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / 'Hide' a category rather than 'Disable' it?

'Hide' a category rather than 'Disable' it?

Views: 3,202

Results 1 to 12 of 12
29 Dec 2013, 3:40 PM
#1
pewe avatar

pewe

Zen Follower

Join Date:
Aug 2006
Posts:
134
Plugin Contributions:
0

'Hide' a category rather than 'Disable' it?

I would like to 'hide' a category from visitors rather than 'disable' it in admin - the items in the category are linked to other categories but I would like them to be active in the store and visible to visitors only in the 'linked' category and for the 'main' category to not visible to visitors - so the items only appear once in the store.

If this is possible, can anyone advise me how to do it??


Background Reason.
I have a number of items which are too heavy to ship and require collection only, but each item is from a different 'category' - eg exercise equipment or tooling.

I have seen a mod by AJEH which will allow me to only have 'store pickup' as an option for a specific category (using a hard code of the category ID).
However this requires all 'collection only' items to be in the same category (eg 'Store Pickup') rather than in their 'real' categories.

My thought was to add all collection only items to the same category ('Store Pickup') then to 'link' them to their correct categories for viewing - BUT to hide the 'Store Pickup' category so they don't appear twice in the store.

29 Dec 2013, 6:01 PM
#3
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: 'Hide' a category rather than 'Disable' it?

pewe:

I would like to 'hide' a category from visitors rather than 'disable' it in admin - the items in the category are linked to other categories but I would like them to be active in the store and visible to visitors only in the 'linked' category and for the 'main' category to not visible to visitors - so the items only appear once in the store.

If this is possible, can anyone advise me how to do it??


Background Reason.
I have a number of items which are too heavy to ship and require collection only, but each item is from a different 'category' - eg exercise equipment or tooling.

I have seen a mod by AJEH which will allow me to only have 'store pickup' as an option for a specific category (using a hard code of the category ID).
However this requires all 'collection only' items to be in the same category (eg 'Store Pickup') rather than in their 'real' categories.

My thought was to add all collection only items to the same category ('Store Pickup') then to 'link' them to their correct categories for viewing - BUT to hide the 'Store Pickup' category so they don't appear twice in the store.

Are you sure that it "requires" the product to have a master category of this "collection only" category and that it can not be the linked item? That way after some other changes possibly, the collection only category may be turned off without any effect? Depending on what is needed through the process path, a link is generated in another table when a product is linked and therefore it could be looked up with a slight change of the SQL that was provided to solve the problem; however, if later SQL statements (core related) must be changed, I would stick with the path of trying to hide the category rather than do too much custom coding.

30 Dec 2013, 1:47 AM
#4
pewe avatar

pewe

Zen Follower

Join Date:
Aug 2006
Posts:
134
Plugin Contributions:
0

Re: 'Hide' a category rather than 'Disable' it?

mc12345678:

Are you sure that it "requires" the product to have a master category of this "collection only" category and that it can not be the linked item?

I need for the master category of the product to be the one that is hidden, and the product to be linked to the 'real' category - but when I disable the master category in admin the products are disabled too - so they no longer appear in their 'real' category.

I have found a way to do what I need.

I manually set the 'status' for the required category to hidden (0) in the sql database. This disables the category from viewing in the store. However, because the products in the category still have a status of 'not disabled' (1), they still appear in the 'real' categories in the store.
So my needs are satisfied for present - unless I find this manual alteration to the category status affects something else too.

So obviously the way the 'disable' function is written for categories it also sets the 'disabled' fag for the products in the category, but I guess for a coder it would be a simple enough mod to add an option in admin such that when disabling the category it allowed for the possibility to NOT disable the linked products - but not being a coder I may be mistaken on that.:smile:

30 Dec 2013, 3:44 AM
#5
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: 'Hide' a category rather than 'Disable' it?

stevesh:

This, maybe:

http://www.zen-cart.com/downloads.php?do=file&id=254

I haven't used it.

I have.. hideCategories will do exactly what the OP is after..

30 Dec 2013, 12:22 PM
#6
pewe avatar

pewe

Zen Follower

Join Date:
Aug 2006
Posts:
134
Plugin Contributions:
0

Re: 'Hide' a category rather than 'Disable' it?

DivaVocals:

I have.. hideCategories will do exactly what the OP is after..

Thanks Diva.
I looked at that plugin and there seemed to be a lot of files to upload/modify, so when I discovered that manually altering the database 'status' field did the job I thought I'd try that first - and it seems to work.

30 Dec 2013, 4:32 PM
#7
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: 'Hide' a category rather than 'Disable' it?

pewe:

I need for the master category of the product to be the one that is hidden, and the product to be linked to the 'real' category - but when I disable the master category in admin the products are disabled too - so they no longer appear in their 'real' category.

I have found a way to do what I need.

I manually set the 'status' for the required category to hidden (0) in the sql database. This disables the category from viewing in the store. However, because the products in the category still have a status of 'not disabled' (1), they still appear in the 'real' categories in the store.
So my needs are satisfied for present - unless I find this manual alteration to the category status affects something else too.

So obviously the way the 'disable' function is written for categories it also sets the 'disabled' fag for the products in the category, but I guess for a coder it would be a simple enough mod to add an option in admin such that when disabling the category it allowed for the possibility to NOT disable the linked products - but not being a coder I may be mistaken on that.:smile:

So, again not knowing the spcific change(s) made to get the concept to work, my thought was to see if the information could be gathered through the use of the product_to_categories table in such a way that the product's master category would be the original and it would be linked to the "special" category. That way the special category could be disabled, which would leave the original category and its product(s) active, and that possibly the unique code to handle the special category would ignore the disabled status.
I state this also without knowing the affect of disabling a category that has a product linked to it, whether. The link is removed from the table, or anything else that would require a manual change like described above. (Make sure you leave yourself some good documentation about that process, never know how often or little you may need to use it and maybe one day will go a route that is controlled more than manually making changes.)

30 Dec 2013, 5:33 PM
#8
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: 'Hide' a category rather than 'Disable' it?

pewe:

Thanks Diva.
I looked at that plugin and there seemed to be a lot of files to upload/modify, so when I discovered that manually altering the database 'status' field did the job I thought I'd try that first - and it seems to work.

It's a lot of files because products and categories appear in MANY places.. hideCategories makes sure that hidden products and categories don't "accidentally" appear where you don't want them to appear. (site maps, search results, etc..)

30 Dec 2013, 8:10 PM
#9
pewe avatar

pewe

Zen Follower

Join Date:
Aug 2006
Posts:
134
Plugin Contributions:
0

Re: 'Hide' a category rather than 'Disable' it?

DivaVocals:

It's a lot of files because products and categories appear in MANY places.. hideCategories makes sure that hidden products and categories don't "accidentally" appear where you don't want them to appear. (site maps, search results, etc..)

Once again, thanks for the input guys.

Diva.

I am not too concerned about the category showing up elsewhere - as long as it does not appear in the store pages.
In my situation I am not trying to keep anything from my visitors as all the items in the hidden category (now named 'Collection Only') are visible elsewhere - I am just keeping the category from view to avoid confusion in the store as the same product (and there is only one of each) would appear twice.

Strangely though , when I view the Site Map all the other categories show - except the Collection Only, and if I do a search on the name of the category, the only items showing up are those which have 'collection only' in their description - which is as I want.

So it appears my 'method' appears to be working for me - although it may not be for others for the reasons you mention.

Thanks again.

30 Dec 2013, 9:01 PM
#10
frank18 avatar

frank18

Deceased

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

Re: 'Hide' a category rather than 'Disable' it?

pewe:

..............I have a number of items which are too heavy to ship and require collection only, but each item is from a different 'category' - eg exercise equipment or tooling.

I have seen a mod by AJEH which will allow me to only have 'store pickup' as an option for a specific category (using a hard code of the category ID).
However this requires all 'collection only' items to be in the same category (eg 'Store Pickup') rather than in their 'real' categories.

My thought was to add all collection only items to the same category ('Store Pickup') then to 'link' them to their correct categories for viewing - BUT to hide the 'Store Pickup' category so they don't appear twice in the store.

No need to go through all that hassle in setting up a cat and then hiding it etc etc

My PDP mod (see http://www.zen-cart.com/downloads.php?do=file&id=1702 ) lets you configure individual items as Store Pickup / Local Delivery Only. Just make sure you uninstall Store Pickup before uploading the modified files and then re-install it after the mod is installed.

Cheers / Frank

31 Dec 2013, 3:42 PM
#11
pewe avatar

pewe

Zen Follower

Join Date:
Aug 2006
Posts:
134
Plugin Contributions:
0

Re: 'Hide' a category rather than 'Disable' it?

frank18:

No need to go through all that hassle in setting up a cat and then hiding it etc etc

My PDP mod (see http://www.zen-cart.com/downloads.php?do=file&id=1702 ) lets you configure individual items as Store Pickup / Local Delivery Only. Just make sure you uninstall Store Pickup before uploading the modified files and then re-install it after the mod is installed.

Cheers / Frank

Thanks Frank.

I had a look at your plugin but, useful as it seems to be, for various reasons I think the method I have employed suits my needs better.

I only had to set up the 'hidden' category once and turn visibility off in the database. Thereafter I just add products to this category in admin, then set it as a linked product - job done with only one extra (quick) operation to deal with.

Thanks again for your input.

1 Jan 2014, 12:04 AM
#12
frank18 avatar

frank18

Deceased

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

Re: 'Hide' a category rather than 'Disable' it?

pewe:

Thanks Frank.

I had a look at your plugin but, useful as it seems to be, for various reasons I think the method I have employed suits my needs better.

I only had to set up the 'hidden' category once and turn visibility off in the database. Thereafter I just add products to this category in admin, then set it as a linked product - job done with only one extra (quick) operation to deal with.

Thanks again for your input.

No problem, the main thing is that it works for you. Thanks for the update.

Cheers / Frank