Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2006
    Posts
    223
    Plugin Contributions
    0

    Default Show qty in stock if greater than 0

    Hi
    Would it be really difficult to modify the "Show Quantity In Stock" switch (Catalog>Product Types>Edit Layout) to ONLY show how many of an item is in stock, if the stock count is greater than zero? (On the product info page) Then if the in stock quantity is zero or less, the stock count would disappear from the product info page. Could someone point me in the right direction as to what and where to modify, I'm kind of helpless with PHP.

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

    Default Re: Show qty in stock if greater than 0

    You could customize your template for that with the templates and overrides for whatever product type you need to do this on ...
    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
    Oct 2006
    Posts
    223
    Plugin Contributions
    0

    Default Re: Show qty in stock if greater than 0

    I just need it for the product type General, but I don't know what file(s) to modify, or how the code should look.

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

    Default Re: Show qty in stock if greater than 0

    You would want to customize your template for the products _info page ...

    Copy the file:
    /includes/templates/templates_default/templates/tpl_product_info_display.php

    to your templates and overrides directory, using whatever your template directory is for the your_templates_dir ...
    /includes/templates/your_template_dir/templates/tpl_product_info_display.php

    and find the line:
    PHP Code:
    <?php   echo (($flag_show_product_info_quantity == 1) ? '<li>' $products_quantity TEXT_PRODUCT_QUANTITY '</li>'  '') . "\n"?>
    and change it to:
    PHP Code:
      <?php
    if ($products_quantity 1) {
      echo 
    'NOTHING';
    } else   {
      echo ((
    $flag_show_product_info_quantity == 1) ? '<li>' $products_quantity TEXT_PRODUCT_QUANTITY '</li>'  '') . "\n";
    }
      
    ?>
    Then you can set the
    echo 'NOTHING';

    once it is working, to read:
    //echo 'NOTHING';

    for future reference and to block the line ...
    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!

  5. #5
    Join Date
    Oct 2006
    Posts
    223
    Plugin Contributions
    0

    Default Re: Show qty in stock if greater than 0

    Linda, thanks so much, worked great, you're amazing like always. Thanks again, tip sent.

    Kyle

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

    Default Re: Show qty in stock if greater than 0

    Thanks for letting us know that this was a solution 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. How can I dispaly stock quantities only if quantity in stock is greater than zero?
    By Liamv in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 22 Feb 2013, 12:39 AM
  2. Adding products greater than the quantity in stock.
    By namae in forum Managing Customers and Orders
    Replies: 1
    Last Post: 15 Jan 2009, 06:10 PM
  3. Bolding or Hightlighting items with QTY greater than 1
    By TJB in forum General Questions
    Replies: 0
    Last Post: 8 Sep 2008, 12:34 PM
  4. allow ordering less than Product Qty Minimum when stock is low
    By dandan in forum Customization from the Admin
    Replies: 1
    Last Post: 30 May 2008, 10:13 PM
  5. Customer able to order more than qty. in stock.
    By hanger 18 in forum Managing Customers and Orders
    Replies: 2
    Last Post: 20 Feb 2008, 06:29 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