Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default preventing category, and products display in new box

    Hi,

    is it possible to prevent a specific category, and its products from displaying in the "new products" box?
    If yes how can it be done?

    On a side note would it be advisable as per SEO?

    Thank you

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: preventing category, and products display in new box

    You could block them based on the master_categories_id by using your templates and overrides and customizing:
    /includes/modules/new_products.php

    to the file:
    /includes/modules/your_templates_directory/new_products.php

    And add to the 2 SELECT statements something like, for example to block categories_id 10, us:
    Code:
    and p.master_categories_id != 10
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: preventing category, and products display in new box

    Thank you.

    If you don't mind I would need a little (lot) more info, not being a coder.

    I put the snip you suggested like this
    Code:
    select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, pd.products_description,
                                    p.products_date_added, p.products_price, p.products_type, p.master_categories_id and p.master_categories_id != 66
    But it does display the product inserted in that category (id 66), both in the new products box, and in the new products listing page.

    Will you kindly tell me how exactly I should add your code?

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: preventing category, and products display in new box

    In the first SELECT, to block master_categories_id 10 try using:
    Code:
      $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                    p.products_date_added, p.products_price, p.products_type, p.master_categories_id
                               from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                               where p.products_id = pd.products_id
    and p.master_categories_id != 10
                               and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                               and   p.products_status = 1 " . $display_limit;
    Then do the same in the other SELECT statement in that file ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: preventing category, and products display in new box

    Thank you again.

    I copy-pasted the code you posted, but it still displays the new product.

    A bit confused on the != 10 is that the category's id number, or it has to be 10?
    I tried both, 10 as per your code, and 66 as the category id of the store.
    Last edited by keneso; 26 May 2012 at 07:16 PM. Reason: misspelling

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: preventing category, and products display in new box

    If your Category is categories_id 66 and your Products use that as their master_categories_id then you want to use:
    Code:
    and p.master_categories_id != 66
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: preventing category, and products display in new box

    Thank you for your patience.

    I added
    and p.master_categories_id != 66
    to
    modules/pages/products_new/header_php.php
    as well, and it works fine.

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: preventing category, and products display in new box

    Thanks for the update that this is now working for you ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  9. #9
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: preventing category, and products display in new box

    I need an update of the code please.

    I added sub-cats to the category with id 66, and noticed they do display, then I added

    Code:
    and p.master_categories_id != 66
    and p.master_categories_id != 67
    and p.master_categories_id != 68
    to /includes/modules/your_templates_directory/new_products.php
    and it works fine.

    Question:
    is that correct way of doing, or there is a group syntax I'm unaware of, i.e.
    Code:
    and p.master_categories_id != '66 67 68'?
    Actually I tried that, and other "creative" combinations, but of course knowing nothing they returned errors.

    Thank you

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: preventing category, and products display in new box

    You need to be using the master_categories_id of the Products that you do not want to display ...

    So if they are in a Category with categories_id 66 then a subcategory where the categories_id is 68, the the master_categories_id is most likely 68 ...

    If you are unsure of the master_categories_id ... edit the Product and you will see:
    Product Master Category:

    and that will list the master_categories_id
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Remove New Products box from display
    By gus1924 in forum Basic Configuration
    Replies: 5
    Last Post: 18 May 2010, 01:56 PM
  2. Replies: 0
    Last Post: 22 Apr 2009, 05:07 PM
  3. Display Category of Products in Featured Products Box?
    By okra17 in forum General Questions
    Replies: 0
    Last Post: 11 Sep 2008, 04:24 PM
  4. Altering the new products box (add manufacturer and category)
    By poosk in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 8 Aug 2008, 12:35 AM
  5. display all products in category box
    By Briank58 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 22 May 2007, 05:50 AM

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