Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,122
    Plugin Contributions
    0

    Default Make a product that is sold out not appear in listings, sideboxes

    Is there any way to make a product which is marked as sold out, not appear in product listings, centreboxes etc.

    I don't want to delete the product or turn it off as that makes a page not found, so I want to mark it as sold out, but not come up in the current products listings on my sites.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,681
    Plugin Contributions
    6

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    For the Product Listing, edit the file:
    /includes/index_filters/default_filter.php

    and where you find in each of the SELECT statements:
    Code:
           where p.products_status = 1
    add to it:
    Code:
           where p.products_status = 1
           and p.products_quantity > 0
    For the Centerboxes, you would need to do the same thing, example for the Featured Products centerbox edit the file, using your templates and overrides:
    /includes/modules/featured_products.php

    copy to:
    /includes/modules/your_templates_dir/featured_products.php

    and add the same thing to each of the SELECT statements:
    Code:
                               and p.products_status = 1 and f.status = 1
    to read:
    Code:
                               and p.products_status = 1 and f.status = 1
                               and p.products_quantity > 0
    and that will prevent the display of Sold Out Products ...
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #3
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,122
    Plugin Contributions
    0

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    Excellent thanks.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,681
    Plugin Contributions
    6

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    Thanks for the update that this worked 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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  5. #5
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,122
    Plugin Contributions
    0

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    Actually, couple of issues. Those products still show in searches (and not for those particular products - but they just happen to have a keyword used in it, ie 'dress') and they still show in the new products page and all products page.

    Any way of preventing this?

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,681
    Plugin Contributions
    6

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    Peek at the:
    /includes/modules/pages/advanced_search_result/header_php.php

    Code:
    $where_str = " WHERE (p.products_status = 1
                   AND p.products_id = pd.products_id
                   AND pd.language_id = :languagesID
                   AND p.products_id = p2c.products_id
                   AND p2c.categories_id = c.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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  7. #7
    Join Date
    Jun 2006
    Posts
    385
    Plugin Contributions
    0

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    Hi Ajeh,
    Following your above advice, I was sucessfull in removing"Sold Out" items from the "Product Listings", and "Advanced Search Results".

    I have not been able to prevent them showing on the "Specials" "Featured""All Products"

    I Have recently added this line:
    $listing_sql .= " order by IF( p.products_quantity >0, 1, 0 ) DESC , p.products_sort_order , pd.products_name";
    To: /includes/index_filters/default_filter.php
    Around line 107. Though I dont think this would have an effect on the other pages I am trying to stop the sold out items showing.
    Thanks
    Regards
    Renz

  8. #8
    Join Date
    Jun 2006
    Posts
    385
    Plugin Contributions
    0

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    Update..

    I have now done it for "All Products" & "New Products"

    Nice and easy.

    These though are not playing nice. (I actually deleted/renamed them and they still work, so for some reason I am not editing the right ones, but I triple checked that I am going to the below file structure locations)

    Featured….
    includes/modules/theme163/featured_products.php
    and p.products_quantity > 0

    Specials…
    You need to customize the code for the:
    /includes/modules/pages/specials/main_template_vars.php

    and add to the WHERE statement something like:
    AND p.products_quantity > 0

    I look fwd to any assistance.
    Regards
    Renz

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,681
    Plugin Contributions
    6

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    On the:
    /includes/modules/pages/specials/main_template_vars.php

    You are using:
    Code:
      $specials_query_raw = "SELECT p.products_id, p.products_image, pd.products_name,
                              p.master_categories_id
                             FROM (" . TABLE_PRODUCTS . " p
                             LEFT JOIN " . TABLE_SPECIALS . " s on p.products_id = s.products_id
                             LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
                             WHERE p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1'
                             AND s.status = 1
                             AND p.products_quantity > 0
                             AND pd.language_id = :languagesID
                             ORDER BY s.specials_date_added DESC";
    and added to both SELECT statements:
    Code:
      $featured_products_query = "select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id
                               from (" . TABLE_PRODUCTS . " p
                               left join " . TABLE_FEATURED . " f on p.products_id = f.products_id
                               left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
                               where p.products_id = f.products_id
                               and p.products_id = pd.products_id
                               and p.products_status = 1 and f.status = 1
                             AND p.products_quantity > 0 
                               and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
    Code:
        $featured_products_query = "select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id
                                    from (" . TABLE_PRODUCTS . " p
                                    left join " . TABLE_FEATURED . " f on p.products_id = f.products_id
                                    left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id)
                                    where p.products_id = f.products_id
                                    and p.products_id = pd.products_id
                                    and p.products_status = 1 and f.status = 1
                             AND p.products_quantity > 0 
                                    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                                    and p.products_id in (" . $list_of_products . ")";
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  10. #10
    Join Date
    Jun 2006
    Posts
    385
    Plugin Contributions
    0

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    I am sorry Ajeh,
    I really struggle to follow what you are telling me...I am limited with Scripts to.
    Find/Change this goes there.
    I dont understand the 2 select statements.
    Also the example line of mine:
    WHERE p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1'
    AND s.status = 1
    AND p.products_quantity > 0
    AND pd.language_id = :languagesID

    Looks different to yours..
    where p.products_id = f.products_id
    and p.products_id = pd.products_id
    and p.products_status = 1 and f.status = 1
    AND p.products_quantity > 0
    and pd.language_id = '" .

    So its very hard for me to figure it out.
    Thanks
    RR

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Replies: 15
    Last Post: 16 Sep 2012, 04:45 PM
  2. Sold out button only on main page product listings?
    By jt3c in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Jun 2011, 04:14 PM
  3. Make product listing look like the all listings
    By Derek_ICD in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 11 May 2009, 12:42 PM
  4. Make all product listings formatted like Specials?
    By Bad Wolf in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 24 Jun 2008, 05:37 PM
  5. Make a product go to affiliate link not product page (sold out)
    By apemusic in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 29 May 2006, 09:03 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
  •