Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2006
    Posts
    449
    Plugin Contributions
    0

    Default How do I keep Sold Items from appearing on new products?

    I am looking though the archives but have yet to find this answer. Any help would be greatly appreciated.
    I keep all of my products, even the SOLD ones in the shop. The reason being is that if folks want to leave a comment or a review, the item still has to be present, whether sold or not. Not wanting to forfeit any opportunities for reviews......all products stay.....sold or not.

    My question is, how to do I get SOLD products to NOT show up in the New Products on the main/front page of the cart? Is there a way to do this? I hear it is frustrating to find a product they have been looking for, only to click on it and see it is sold. Shopping carts can be a frustrating beast to those who are not familiar, so i want to make this as seamless and stress free as possible :)

    So, is there a way to make sure SOLD products do not show up in the new products?

    Thank you.

  2. #2
    Join Date
    Oct 2007
    Posts
    143
    Plugin Contributions
    0

    Default Re: How do I keep Sold Items from appearing on new products?

    you could modify the new products sql to omit any products with quantity = 0. (assuming you are using the quantity fields on products).

    in /includes/modules/pages/products_new/header.php, change this:
    PHP Code:
    $products_new_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
                                 WHERE p.products_status = 1
                                 AND p.products_id = pd.products_id
                                 AND pd.language_id = :languageID " 
    $display_limit $order_by
    to this: (note the additional "AND" statement)

    PHP Code:
    $products_new_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
                                 WHERE p.products_status = 1
                                 AND p.products.quantity > 0
                                 AND p.products_id = pd.products_id
                                 AND pd.language_id = :languageID " 
    $display_limit $order_by

  3. #3
    Join Date
    Oct 2011
    Location
    AZ
    Posts
    384
    Plugin Contributions
    0

    Default Re: How do I keep Sold Items from appearing on new products?

    That looked like something I could use, so I dropped the line of php in, hit save, blew up my site.
    I'm looking to see if I fat-fingered it, but as far as I can tell I added that one line and nothing else, no stray comma or (), just:
    AND p.products.quantity > 0

    ????

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Re: How do I keep Sold Items from appearing on new products?

    Quote Originally Posted by joejoejoe View Post
    That looked like something I could use, so I dropped the line of php in, hit save, blew up my site.
    I'm looking to see if I fat-fingered it, but as far as I can tell I added that one line and nothing else, no stray comma or (), just:
    AND p.products.quantity > 0

    ????
    Change the SQL fragment from AND p.products.quantity > 0 to AND p.products_quantity > 0

  5. #5
    Join Date
    Oct 2011
    Location
    AZ
    Posts
    384
    Plugin Contributions
    0

    Default Re: How do I keep Sold Items from appearing on new products?

    Thanks, I changed the . to _ and it works.

 

 

Similar Threads

  1. v155 can I prevent sold out items from appearing in search
    By mespe in forum General Questions
    Replies: 8
    Last Post: 10 Jul 2016, 05:26 PM
  2. Disabled items appearing in New Products
    By CiderHouse in forum General Questions
    Replies: 2
    Last Post: 22 Mar 2008, 01:46 AM
  3. Replies: 5
    Last Post: 18 Mar 2008, 08:17 PM
  4. Old items appearing in 'New Products' sidebox
    By millo_magno in forum Basic Configuration
    Replies: 6
    Last Post: 18 Jun 2007, 02:59 AM
  5. How to keep the Qty Discount box from appearing?
    By benjames in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 21 Sep 2006, 11:35 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