Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2007
    Posts
    178
    Plugin Contributions
    0

    Default Is there a way to make "Featured Products" show only specific category?

    Is there a way to only show one category in the "Featured Products" on the main page?

  2. #2
    Join Date
    Jul 2005
    Location
    Orlando, Fl
    Posts
    324
    Plugin Contributions
    0

    Default Re: Is there a way to make "Featured Products" show only specific category?

    If you're using the featured products list box on the home page, you can limit it to 1 category by adding this:

    AND p.master_categories_id = 89

    to

    tpl_modules_products_featured_list_box.php

    Change 89 to your master category number.

    Find this

    Code:
    $featured_products_query_raw = "SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call,
                                      p.product_is_always_free_shipping, p.products_qty_box_status,
                                      p.master_categories_id
                                      FROM (" . TABLE_PRODUCTS . " p
                                      LEFT JOIN " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " .
    TABLE_PRODUCTS_DESCRIPTION . " pd
                                      LEFT JOIN " . TABLE_FEATURED . " f on pd.products_id = f.products_id )
                                      WHERE p.products_status = 1 and p.products_id = f.products_id and f.status = 1
                                      AND p.products_id = pd.products_id and pd.language_id = :languagesID 
    								  ORDER by f.featured_date_available";
    Change to this:


    Code:
    $featured_products_query_raw = "SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call,
                                      p.product_is_always_free_shipping, p.products_qty_box_status,
                                      p.master_categories_id
                                      FROM (" . TABLE_PRODUCTS . " p
                                      LEFT JOIN " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " .
    TABLE_PRODUCTS_DESCRIPTION . " pd
                                      LEFT JOIN " . TABLE_FEATURED . " f on pd.products_id = f.products_id )
                                      WHERE p.products_status = 1 and p.products_id = f.products_id and f.status = 1
                                      AND p.master_categories_id = 89
                                      AND p.products_id = pd.products_id and pd.language_id = :languagesID 
    								  ORDER by f.featured_date_available";

    Keep in mind, this will NOT change the featured_products page but WILL change anywhere in the site that uses the featured box.

    Another way would be, Since the default is to order them by fettered date, to limit the amount of items that the featured list box shows in the admin, and then set the available dates accordingly to sort them a specific way.

    Lets say you have 5 items in that category you want to show, then set the limit to 5 and use the available dates to sort the 5 top the top.

  3. #3
    Join Date
    Sep 2007
    Posts
    178
    Plugin Contributions
    0

    Default Re: Is there a way to make "Featured Products" show only specific category?

    Thanks Dave!
    My ZC didn't have the file you mentioned, but doing a search, I found the code listed in
    /modules/pages/featured_products/header_php.php

    Added the code you gave and it seems to have worked.
    Do you know if changing the code I changed will cause issues elsewhere on my site?

    Thanks again!

  4. #4
    Join Date
    Jul 2005
    Location
    Orlando, Fl
    Posts
    324
    Plugin Contributions
    0

    Default Re: Is there a way to make "Featured Products" show only specific category?

    Quote Originally Posted by RFree190 View Post
    Thanks Dave!
    My ZC didn't have the file you mentioned, but doing a search, I found the code listed in
    /modules/pages/featured_products/header_php.php

    Added the code you gave and it seems to have worked.
    Do you know if changing the code I changed will cause issues elsewhere on my site?

    Thanks again!
    Yes, you're right, I had created a separate template called list box. Sorry about that.

    Adding the AND clause will only affect the output of the featured products page and box.

    I wanted different results for the page and box so I created an additional template.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 10 Aug 2011, 02:07 AM
  2. How to remove sub-category "featured products" & "category image"?
    By andrewcklau in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 24 Jun 2010, 10:32 AM
  3. Replies: 1
    Last Post: 31 Jul 2009, 01:07 PM
  4. make product details show up in "featured products" center box on main page
    By traypup in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 31 Mar 2009, 01:41 AM
  5. Show "All Products" (Sidebox) Link on Category/Product Pages ONLY?
    By msmith29063 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 30 Nov 2008, 04:46 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