Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2007
    Posts
    110
    Plugin Contributions
    0

    Default Featured products in admin shows items not in stock

    Hi,
    we have a store which have about 50% of the products inactive from time to time.
    But when adding a featured product from admin all products shows in the selectbox even though its inactive or not in stock?
    Is it possible to change this to only show products that are actually active?
    Ive searched around here but couldnt find anything.

    Thanks,
    Jagge

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

    Default Re: Featured products in admin shows items not in stock

    You could customize it to change this section of code so that the SQL statement has additional conditions for what to exclude:
    Code:
    // do not include things that cannot go in the cart
          $not_for_cart = $db->Execute("select p.products_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCT_TYPES . " pt on p.products_type= pt.type_id where pt.allow_add_to_cart = 'N'");
    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!]
    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
    Jan 2007
    Posts
    159
    Plugin Contributions
    0

    Default Re: Featured products in admin shows items not in stock

    Hi Ajeh

    Do we need to change that in all the scripts that use the $not_for_cart variable? I found it in 4 administrative files, but not in any catalog files. I thought it would be filtered in a catalog script when a product is out of stock.

  4. #4
    Join Date
    Jul 2007
    Posts
    110
    Plugin Contributions
    0

    Default Re: Featured products in admin shows items not in stock

    Thanks Ajeh for the quick answer.
    Not sure what to do though. Im quite a newbie on this. Shall I change something in that codesnippet or add something?

    /Ola

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

    Default Re: Featured products in admin shows items not in stock

    Currently, that SELECT is picking Products that are set to:
    where pt.allow_add_to_cart = 'N'");

    So add on to that ...

    you don't want Products that have the status turned off:
    p.products_status = 0

    or have nothing 0 or less for the quantity:
    p.products_quantity <= 0

    So adding something to the WHERE statement to:
    Code:
    where pt.allow_add_to_cart = 'N' or p.products_quantity <= 0 or products_status =0
    might do the trick ...
    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!]
    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!

  6. #6
    Join Date
    Jul 2007
    Posts
    110
    Plugin Contributions
    0

    Default Re: Featured products in admin shows items not in stock

    Thanks Ajeh!
    That did the trick for sure!

    /Jagge

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

    Default Re: Featured products in admin shows items not in stock

    Thanks for the update that this was able to work 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!]
    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!

 

 

Similar Threads

  1. v151 Categories side links not showing stock, all products shows all stock info
    By Jamie Nicholson in forum General Questions
    Replies: 5
    Last Post: 25 Mar 2014, 06:05 PM
  2. Featured Products Layout not working - Stacking Items, not gridding them
    By JeffTew in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 2 Sep 2010, 12:58 AM
  3. My Cart shows Items out of stock Why?
    By touchclothing in forum General Questions
    Replies: 6
    Last Post: 9 Dec 2008, 11:01 PM
  4. Featured Sidebox still shows when turned of in Admin
    By lbpp in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Oct 2006, 09:49 PM

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