Page 1 of 7 123 ... LastLast
Results 1 to 10 of 70
  1. #1
    Join Date
    May 2006
    Posts
    26
    Plugin Contributions
    0

    Default Show "in stock" instead of showing units in stock

    Hi,

    I would like to remove the units in stock on the product info page and instead only show "In stock" or "not in stock".
    I have found out that the file that controls this is: tpl_products_info_display.php
    and that i probaly should edit the line:

    <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>

    Can anyone instruct me on what is should change the code to?

    Best Regards
    Gustaf

  2. #2
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: Show "in stock" instead of showing units in stock

    Nope!

    You need to edit:

    includes -> languages -> english -> product_info.php

    find this line of code
    Code:
    define('TEXT_PRODUCT_QUANTITY', ' Units in Stock');
    change the portion in red to whatever you want.

    Save the edited file to your CUSTOM folder and upload to your server.

  3. #3
    Join Date
    Jul 2006
    Location
    Ohio
    Posts
    36
    Plugin Contributions
    0

    Default Re: Show "in stock" instead of showing units in stock

    Yep sir...
    One thing with Zen-cart, it is so easy to find out how to change things... Remember with code.. when ever you want to change something that says "change me" There is "change me" somewhere in the code somewhere.. so easy its not even funny

  4. #4
    Join Date
    Jun 2006
    Posts
    96
    Plugin Contributions
    0

    Default Re: Show "in stock" instead of showing units in stock

    Just a newcomer, and I know nothing, but wouldn't that just change the plain-text "Units in stock" message and not effect the amount displayed? So if he were to change it from "Units in stock" to "In Stock," it would then read:

    1000 In Stock

    When (I believe) he just wants it to say:

    In Stock

    Just curious...

  5. #5
    Join Date
    May 2006
    Posts
    26
    Plugin Contributions
    0

    Default Re: Show "in stock" instead of showing units in stock

    You are correct Cfe, that is not what i'm looking for. I want to remove the number that shows the quantity on stock. Any other ideas?

  6. #6
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Show "in stock" instead of showing units in stock

    I think cfe is right.

    Thus, it requires two steps:

    1. clydejones suggestion above
    2. change the code to this:
    PHP Code:
    <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' TEXT_PRODUCT_QUANTITY '</li>' '') . "\n"?>
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    May 2006
    Posts
    26
    Plugin Contributions
    0

    Default Re: Show "in stock" instead of showing units in stock

    Quote Originally Posted by DrByte
    I think cfe is right.

    Thus, it requires two steps:

    1. clydejones suggestion above
    2. change the code to this:
    PHP Code:
    <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' TEXT_PRODUCT_QUANTITY '</li>' '') . "\n"?>
    Thank you, that removed the quantity. But here comes the tricky part: I want the In stock text to change to not in stock when stock is 0. How would i do this?

    Thanks for helping out!
    /Gustaf

  8. #8
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: Show "in stock" instead of showing units in stock

    Look in admin -> configuration -> stock -> Mark product out of stock

    replace *** with Not in Stock

  9. #9
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Show "in stock" instead of showing units in stock

    Quote Originally Posted by gustafr
    Thank you, that removed the quantity. But here comes the tricky part: I want the In stock text to change to not in stock when stock is 0. How would i do this?
    Use this instead:
    PHP Code:
    <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . ($products_quantity TEXT_PRODUCT_IN_STOCK TEXT_PRODUCT_NOT_IN_STOCK) . '</li>' '') . "\n"?>

    Then use a variation on clydejones earlier post, like this:

    includes -> languages -> english -> product_info.php

    find this line of code
    PHP Code:
    define('TEXT_PRODUCT_QUANTITY'' Units in Stock'); 
    and add these below it:
    PHP Code:
    define('TEXT_PRODUCT_IN_STOCK''In Stock');
    define('TEXT_PRODUCT_NOT_IN_STOCK''Out of Stock'); 
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    May 2006
    Posts
    26
    Plugin Contributions
    0

    Default Re: Show "in stock" instead of showing units in stock

    This worked perfectly, thank you for all your help.

 

 
Page 1 of 7 123 ... LastLast

Similar Threads

  1. To show "In stock" but not number of units?
    By Marre in forum Basic Configuration
    Replies: 6
    Last Post: 2 May 2011, 11:03 PM
  2. Show "Units In Stock" for certain product only.
    By laydiefa in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 26 Nov 2008, 08:08 PM
  3. Scaling image instead of "units in stock?"
    By JHouse in forum General Questions
    Replies: 1
    Last Post: 12 May 2008, 06:48 PM
  4. How to NOT show "xxx units in stock"?
    By terrykiwi in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 27 Apr 2008, 07:51 PM
  5. Display "Product is in Stock" instead of units?
    By Corys8646 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 8 Jul 2006, 01:20 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