Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2011
    Posts
    37
    Plugin Contributions
    0

    cart error Setting a max number with a + for items with large stock

    I can`t find a function that I believe must be included in ZC, or can be solved by doing something simple. In my ZC store I show the stock status on each and every product. We have ordered some products in large quantities, and we really don`t want to show the whole stock. Many stores have the simple solution of having a "max" value on stock so instead of "* 105 units in stock", it says "20+ units in stock" (if the max limit is set to 20).

    Can anyone point me in the right direction here?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Setting a max number with a + for items with large stock

    That's normally in a group of <li> tags in the tpl_product_info_display.php template.
    If your PHP skills are up to the task, you can write your customization right there.
    .

    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.

  3. #3
    Join Date
    Nov 2011
    Posts
    37
    Plugin Contributions
    0

    Default Re: Setting a max number with a + for items with large stock

    Ok - thought maybe this was a setting in the admin system as this is quite common presentation of stock.

    I know how to read and search php (I understand programming), but sadly I am not able to write php code. I guess this is the code that needs to be changed:
    PHP Code:
      <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' $products_quantity TEXT_PRODUCT_QUANTITY '</li>'  '') . "\n"?>
    Can anyone rewrite this code for me so that if products_quantity > 20, it shows "20+" instead of the actual number?

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,478
    Plugin Contributions
    88

    Default Re: Setting a max number with a + for items with large stock

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

  5. #5
    Join Date
    Nov 2011
    Posts
    37
    Plugin Contributions
    0

    Default Re: Setting a max number with a + for items with large stock

    Thanks!!

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

    Default Re: Setting a max number with a + for items with large stock

    @lat9, thanks for posting the code. I was away from my development code when I posted earlier so I couldn't post any examples!
    .

    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.

 

 

Similar Threads

  1. v151 Loaded large number of product with Easy Populate now multiple images on each product
    By swdynamic in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 8 May 2015, 08:31 PM
  2. Setting a quantity discount with items with varying attributes?
    By xtina in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 19 May 2010, 12:08 AM
  3. Setting up 1 product with multple sizes - reduce stock item for that size?.
    By lizord in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 8 Apr 2009, 05:43 AM
  4. Masking items with 0 stock from New Products
    By BekahRuth in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 10 Sep 2007, 12:40 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR