hideCategories

Views: 105,228

Results 61 to 80 of 488
1 May 2007, 9:26 AM
#61
figster avatar

figster

New Zenner

Join Date:
Feb 2006
Posts:
85
Plugin Contributions:
0

hideCategories

I was just wondering, if it would be easier to create a new product type, that it's own rules, than it would be to try and hide a category.. Just a thought.

3 May 2007, 4:01 PM
#62
peanut77 avatar

peanut77

Zen Follower

Join Date:
Feb 2005
Posts:
266
Plugin Contributions:
0

Re: hideCategories

Help

I am trying to hide all the products in a category from the search. Th category is invisable so it is not showing up in my menu and I have instaleed the module with no problesm, however the products show up in the search - is there any way to hide these completely so they don't show up in the search.

3 May 2007, 4:17 PM
#63
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: hideCategories

Hi folks,
The answer to everything is "yes". You can do that. As I stated in the first post, I made this specifically for our store and its not a contrib I plan to support at all since there's a million things you could want that someone else wouldn't. Its nearly impossible to release this contrib so that it works for everyone. You'll need to modify it yourself to do what you want.

For example the search request: You'll have to find wherever in Zen the search function(s) exist and have them check to see the hidden status of the category before adding any given product to the results. The hard part is finding the appropriate functions. Once you do, it should be fairly easy. Look at the other files included in the package for hints and how I did it.

Obviously, it takes a good understanding of PHP/SQL as well as good level of zen structure knowledge.

Sorry I can't spend the time with individual requests. I provided the basis... I hope you can use it to get where you want to be.

  • Steven
3 May 2007, 4:51 PM
#64
peanut77 avatar

peanut77

Zen Follower

Join Date:
Feb 2005
Posts:
266
Plugin Contributions:
0

Re: hideCategories

Cheers for your quick reply.

All I need is one category and everything inside this to be hidden.

I kinda presumed this is what the hide category module does? as right now installed on 1.37 it just does exactly the same as changing the staus button to red - is that correct? (or am I being incredibly dumb :-) )

I am reckon I am missing something v.v.v.v basic and I appreciate you don't take requests but as I have only enough php knowledge to allow me to install zen cart I wouldn't even know where to start with functions etc.

Is there anyway you could nudge me in the right direction the only thing I have noticed which may cause it to work as a hide item is there is code in the tpl_products_all file - should this hide code be on all products templates you use?

Sorry to be a pest and thanks for taking the time to reply.

4 May 2007, 1:03 AM
#65
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Re: hideCategories

peanut77:

Help

I am trying to hide all the products in a category from the search. Th category is invisable so it is not showing up in my menu and I have instaleed the module with no problesm, however the products show up in the search - is there any way to hide these completely so they don't show up in the search.

If the module is installed correctly, it shouldn't show up in the search. I had an error with includes/modules/MY_TEMPLATE/product_listing.php, and that caused the producy to NOT be hidden in the search. After I put product_listing.php in the right folder, the product no longer showed up in the search.

4 May 2007, 7:24 AM
#66
peanut77 avatar

peanut77

Zen Follower

Join Date:
Feb 2005
Posts:
266
Plugin Contributions:
0

Re: hideCategories

Jettrue

Your a complete and utter star!! that is all that is was - I thought i'd been through everything with a fine toothcomb!!

Thank you for pointing me in the right direction - much aprreciated.

4 May 2007, 7:17 PM
#67
reza avatar

reza

Zen Follower

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

Re: hideCategories

HI STEVEN
IT's a great contribution, but there is a problem, when I use css flyout category sidebox or header css flyout, the hidden categories are still showing!!!
do you now how can I solve this problem?
thanks

2 Jun 2007, 2:19 AM
#68
tatiana77 avatar

tatiana77

Zen Follower

Join Date:
May 2007
Posts:
114
Plugin Contributions:
0

Re: hideCategories

Just wanted to say that I installed this mod tonight and I love it.

Thank you!

Tatiana:clap:


7 Jul 2007, 4:35 PM
#69
IDEASLady avatar

IDEASLady

Totally Zenned

Join Date:
Aug 2005
Location:
Trujillo Alto, Puerto Rico
Posts:
1,449
Plugin Contributions:
3

Re: hideCategories

john95051:

I am having problem on the 1.36 ZC.

I got following when I click "New Product",

1146 Table 'jun9505_jlcxxxxxx.products_description' doesn't exist
in:
[select count(*) as total FROM jun9505_products p LEFT JOIN jun9505_manufacturers m ON (p.manufacturers_id = m.manufacturers_id) LEFT JOIN jun9505_hide_categories h ON (p.master_categories_id = h.categories_id), products_description pd WHERE (h.visibility_status < 2 OR h.visibility_status IS NULL) AND p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 ]

Note, jlcxxxxxx is the database name, jun9505 is the prefix.
If everything is right, It should looking for Table 'jun9505_products_description'. Any idea on why this happen?

Thanks.

s_mack:

When you put in the included SQL, how did you do it? I've seen this problem come up and this question asked on just about every contrib support forum out there :) I don't know how table prefixes work because mine don't use them (I don't understand why anyone's do)... but the answer always seems to be "input the SQL into phpmyadmin, NOT the SQL tool in your Zen admin!"

Good luck. I'm pretty sure its not a problem with this contrib though.

  • Steven

The jun9505 it's not the prefix is the username of your hosting account.

Smack, I tried your solution, and doesn't fix the issue. I think your SQL query is missing a "description" table? I'm not programmer but that's what it looks from my error as well as the previous poster. The system somehow it's looking for a description that doesn't exist on the table???

Again... I really don't know since I'm not programmer but this issue only comes up when I install this module (which I love BTW).

This is my error:

1146 Table 'USER_DATABASENAME.products_description' doesn't exist
in:
[select count(*) as total FROM _zenproducts p LEFT JOIN _zenmanufacturers m ON (p.manufacturers_id = m.manufacturers_id) LEFT JOIN _zenhide_categories h ON (p.master_categories_id = h.categories_id), products_description pd WHERE (h.visibility_status < 2 OR h.visibility_status IS NULL) AND p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 ]

Is it posible for you or any of the other coder guru look into this?

IDEASLady
IDEAS Creative Studio

Your image... our business!

7 Jul 2007, 5:19 PM
#70
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: hideCategories

Someone else will have to help. I'm really short on time, but more than that... I really just don't get the whole prefix thing as I've never used them... the two that have had problems, it is related to prefixes.

Its not missing a description table. "products_description" exists, but "USER_DATABASENAME.products_description" does not... why your cart is trying to add that prefix is what I don't understand.

I'm sure its not complicated... and I'm sure someone that gets prefixes can answer exactly what you have to do. I've personally never worked with a host that does that. I don't even know why or when prefixes come about. So I can't help. But its not the contrib... or if it is, it is only the contrib on hosts like yours that use prefixes.

  • Steven
8 Jul 2007, 2:52 PM
#71
motas avatar

motas

New Zenner

Join Date:
Mar 2007
Posts:
9
Plugin Contributions:
0

Re: hideCategories

ideasgirl:

The system somehow it's looking for a description that doesn't exist on the table???

ideasgirl, it appears you're having the same problem I had. The system is looking for a table without a prefix because the constant DB_PREFIX is missing in the PHP code.

Have a look at page 5 of this thread, the last reply (direct link here: http://www.zen-cart.com/forum/showpost.php?p=338852&postcount=50 )

This seems to have fixed the problem for me.

good luck,
marc...

8 Jul 2007, 5:02 PM
#72
IDEASLady avatar

IDEASLady

Totally Zenned

Join Date:
Aug 2005
Location:
Trujillo Alto, Puerto Rico
Posts:
1,449
Plugin Contributions:
3

Re: hideCategories

This seems to have fixed the problem for me.
It did it for me as well... thanks! :yes:

IDEASLady
IDEAS Creative Studio

Your image... our business!

8 Jul 2007, 6:02 PM
#73
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: hideCategories

Oh right... jeeze... I thought I had fixed that! I'm uploading now.

Thanks.

  • Steven
13 Jul 2007, 1:20 AM
#74
daemin avatar

daemin

New Zenner

Join Date:
Jul 2007
Posts:
2
Plugin Contributions:
0

Re: hideCategories

I modified it to stop it from displaying products in a completely hidden category from showing up in the "also bought" box.

Here are the changes:

In includes/class/db/mysql/define_queries.php

Change:

DEFINE('SQL_ALSO_PURCHASED', "select p.products_id, p.products_image
                     from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, "
                            . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p
                     where opa.products_id = '%s'
                     and opa.orders_id = opb.orders_id
                     and opb.products_id != '%s'
                     and opb.products_id = p.products_id
                     and opb.orders_id = o.orders_id
                     and p.products_status = 1
                     group by p.products_id
                     order by o.date_purchased desc
                     limit " . MAX_DISPLAY_ALSO_PURCHASED);

To:

DEFINE('SQL_ALSO_PURCHASED', "select p.products_id, p.products_image
                     from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, "
                            . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p, " . TABLE_HIDE_CATEGORIES . " h
                     where opa.products_id = '%s'
                     and opa.orders_id = opb.orders_id
                     and opb.products_id != '%s'
                     and opb.products_id = p.products_id
                     and opb.orders_id = o.orders_id
                     and p.products_status = 1
                     and (p.master_categories_id = h.categories_id and h.visibility_status !=2)
                     group by p.products_id
                     order by o.date_purchased desc
                     limit " . MAX_DISPLAY_ALSO_PURCHASED);  

This modifies the query that generates content for the "also purchased" box to exclude products in totally hidden categories. The only problem with this is that categories that have never been set to be hidden or not are also excluded.

For pre-existing categories, you must explicitly set them to be normal. For those comfortable with doing so, you can simply insert records into the "hidden_categories" table with all your category IDs.

For new categories, the following modification will automatically insert a record into the table for you.

In admin/categories.php, you need to find the bottom of the code block that contains the code for inserting a new record. In the current version of Zen Cart (1.3.7.1), this is located at aprox. line 196.

The unmodified code looks like this:

      if ($has_type->RecordCount() < 1) {
              $insert_sql_data = array('category_id' => $categories_id,
                                       'product_type_id' => $parent_product_type->fields['product_type_id']);

              zen_db_perform(TABLE_PRODUCT_TYPES_TO_CATEGORY, $insert_sql_data);

            }
          }
        }
      } elseif ($action == 'update_category') {
        $update_sql_data = array('last_modified' => 'now()');

Change it to this:

    if ($has_type->RecordCount() < 1) {
             $insert_sql_data = array('category_id' => $categories_id,
                                      'product_type_id' => $parent_product_type->fields['product_type_id']);

             zen_db_perform(TABLE_PRODUCT_TYPES_TO_CATEGORY, $insert_sql_data);

           }
         }
       }
       
      // INSERT THE LINE BELOW!!!
   	zen_db_perform(TABLE_HIDE_CATEGORIES, array('categories_id' => $categories_id, 'visibility_status' => 0));
      // INSERT THE LINE ABOVE!!!        
     } elseif ($action == 'update_category') {
       $update_sql_data = array('last_modified' => 'now()');

This will create a record in the hide_categories table for all new categories, and set them to be normal.

Next up will be a modification to prevent hidden products form showing up in the "new products" box.

13 Jul 2007, 2:57 AM
#75
daemin avatar

daemin

New Zenner

Join Date:
Jul 2007
Posts:
2
Plugin Contributions:
0

Re: hideCategories

Ok. To remove hidden products from the "Whats New" box, you need to edit

includes/modules/sideboxes/whats_new.php

On line 15, change the query from

  $random_whats_new_sidebox_product_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price
                           from " . TABLE_PRODUCTS . " p
                           where p.products_status = 1 " . $display_limit . "
                           limit " . MAX_RANDOM_SELECT_NEW;

To

  $random_whats_new_sidebox_product_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price
                           from " . TABLE_PRODUCTS . " p, " . TABLE_HIDE_CATEGORIES . " h
                           where p.products_status = 1 
                           and (p.master_categories_id = h.categories_id and h.visibility_status !=2) 
                           " . $display_limit . "
                           limit " . MAX_RANDOM_SELECT_NEW;

As before, this only works correctly if every category has an entry in the hidden_categories table.

13 Jul 2007, 4:17 AM
#76
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: hideCategories

To avoid having to make every category have an entry in hidden_categories, you can do a two-parter.. simply check if it has an entry first, and if it does, check what its status is. If not, operate as normal. More work on the coding, but a LOT less work on the admin.

  • Steven
25 Jul 2007, 9:21 AM
#77
blag avatar

blag

Zen Follower

Join Date:
May 2007
Location:
Leicester, England
Posts:
165
Plugin Contributions:
0

Re: hideCategories

I haven't tried this mod, but it seems as if it might resolve a problem that I have with my store. It would appear that there is a bug in ZC 1.3.7 (and 1.3.7.1) if one uses 'linked' products, in that in some circumstances a product's 'linked' category appears to take precedence over the product's master category - according to ajeh, it's a bug due to be fixed in release 1.3.8 but there is not ETA for 1.3.8!!

To explain - you might have a product A (of a series A;B;C...) in Master category 'Brand' which, for example, is linked to sizes 1;2;3;4; & 5 in the 'Size' category. You select the product via the Brand category menu, but the product appears with all the header info relating to one of the product's 'linked sizes', and the previous/next buttons take you to other products of the same size, not of the same brand!!

I have included the available sizes for all the products as product attributes, but the sizes are not found in a search by using the ZC search box - even in the advanced mode of the search.

I am sure that some of my customers would like to search my site via Size, so here are my questions - if I were to use the Hide categories mod, and include a Size category, but hide it, and then link my products to the size category:
a) I presume that the ZC search for items by Size will work
b) will it overcome the 'linked items' bug that I have described?

Or does someone know of a way to facilitate a search by attributes?

27 Jul 2007, 1:30 AM
#78
cyberwoolf avatar

cyberwoolf

Zen Follower

Join Date:
Oct 2005
Posts:
97
Plugin Contributions:
0

Re: hideCategories

This mod is awesome!! I love it.. I even figured out how to password protect the categories using htaccess and sefu with access to different users woo

I was wondering though... when I search via the sidebox search the products in the category still show up. It doesnt with advanced search but with the sidebox.. how do I have it not show up in the sidebox search?

3 Aug 2007, 4:10 PM
#79
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: hideCategories

blag:

so here are my questions - if I were to use the Hide categories mod, and include a Size category, but hide it, and then link my products to the size category:
a) I presume that the ZC search for items by Size will work
b) will it overcome the 'linked items' bug that I have described?

Or does someone know of a way to facilitate a search by attributes?

I'm sorry, but your needs go way beyond help by me :) I knew stuff like this would come up when I made this mod and that's the problem with it - there's no cap to what you can want to do with it, and there's no way (short of quitting my job) to keep everyone happy and implement everything. I'm sure you can do what you want, but I have no experience with linked categories at all. Best of luck.

CyberWoolf:

This mod is awesome!! I love it.. I even figured out how to password protect the categories using htaccess and sefu with access to different users woo

I was wondering though... when I search via the sidebox search the products in the category still show up. It doesnt with advanced search but with the sidebox.. how do I have it not show up in the sidebox search?

This should be easier, but again - I can't really help... no time. I've left hints in the readme on how to modify files yourself to work with the hidden categories. I hope it helps.

  • Steven
21 Sep 2007, 7:37 PM
#80
supersnow avatar

supersnow

Zen Follower

Join Date:
Apr 2007
Location:
California, USA
Posts:
233
Plugin Contributions:
0

Re: hideCategories

CyberWoolf:

This mod is awesome!! I love it.. I even figured out how to password protect the categories using htaccess and sefu with access to different users woo

I was wondering though... when I search via the sidebox search the products in the category still show up. It doesn't with advanced search but with the sidebox.. how do I have it not show up in the sidebox search?

Can you post your solution on how you have this mod working so it allows access to the hidden categories to different users. Or even better uploaded the ungraded module in the downloads section. I believe that a lot of people here would be really excited to see that upgrade.

S_mack I think this is a great module and I know you don't have time to modify the module to incorporate extra features. That is the whole point of a community. For those that work out a solution they add it back to the community. I think you have contributed a hell of a lot that you answer everyones post, not always with a direct solution, but with idea of where to look.

Thanks
Supersnow