Thread: hideCategories

Page 8 of 49 FirstFirst ... 67891018 ... LastLast
Results 71 to 80 of 487
  1. #71
    Join Date
    Mar 2007
    Posts
    9
    Plugin Contributions
    0

    Default Re: hideCategories

    Quote Originally Posted by ideasgirl View Post
    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/showpo...2&postcount=50 )

    This seems to have fixed the problem for me.

    good luck,
    marc...

  2. #72
    Join Date
    Aug 2005
    Location
    Trujillo Alto, Puerto Rico
    Posts
    1,547
    Plugin Contributions
    9

    Default Re: hideCategories

    This seems to have fixed the problem for me.
    It did it for me as well... thanks!
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!

  3. #73
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: hideCategories

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

    Thanks.

    - Steven
    Last edited by s_mack; 8 Jul 2007 at 07:06 PM.

  4. #74
    Join Date
    Jul 2007
    Posts
    2
    Plugin Contributions
    0

    Default 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:
    Code:
    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:

    Code:
    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:

    Code:
          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:

    Code:
         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.

  5. #75
    Join Date
    Jul 2007
    Posts
    2
    Plugin Contributions
    0

    Default 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

    Code:
      $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

    Code:
      $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.

  6. #76
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default 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

  7. #77
    Join Date
    May 2007
    Location
    Leicester, England
    Posts
    165
    Plugin Contributions
    1

    Have a Drink 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?

  8. #78
    Join Date
    Oct 2005
    Posts
    106
    Plugin Contributions
    0

    Default 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?

  9. #79
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: hideCategories

    Quote Originally Posted by blag View Post
    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.

    Quote Originally Posted by CyberWoolf View Post
    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

  10. #80
    Join Date
    Apr 2007
    Location
    California, USA
    Posts
    233
    Plugin Contributions
    0

    Default Re: hideCategories

    Quote Originally Posted by CyberWoolf View Post
    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

 

 
Page 8 of 49 FirstFirst ... 67891018 ... LastLast

Similar Threads

  1. how to get hidecategories an dual pricing to work
    By davidweaver88 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 4 Jun 2012, 03:35 PM
  2. anyone using HideCategories in 1.3.9d??
    By redheads in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 8 Jun 2010, 06:54 AM
  3. HideCategories problem...
    By ShadowAngel in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 10 Nov 2009, 10:17 PM
  4. hideCategories Module
    By marcusimages in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 25 Aug 2009, 06:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR