Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Oct 2008
    Posts
    27
    Plugin Contributions
    0

    Default Stock Level Indicator in Product Info Page

    I'd like to have, instead of the string

    "5 units available....."

    a stock level indicator like a JPG or to write just if the product is available or not

    How can I do it?

    I tried to do this in tpl_product_info_display.php

    <?php //*echo (($flag_show_product_info_quantity == 1) ? '' .
    if {$products_quantity>1} {echo 'Available';} ?>
    but it gives me an error

    What should i do?

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Stock Level Indicator in Product Info Page

    The following (untested) is more likely to do the job
    <?php if ($flag_show_product_info_quantity == 1 && $products_quantity >= 1) echo 'Available' ?>
    (assuming that your site is entirely in English)
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Oct 2008
    Posts
    27
    Plugin Contributions
    0

    Default Re: Stock Level Indicator in Product Info Page

    Hi! Thanks for ur help

    I've found a solution in the while...

    <?php
    if (zen_get_products_stock((int)$_GET['products_id']) >0) {
    $zc_stock_level_image = '<span class="Disponibile">Disponibile</span>';
    }

    elseif (zen_get_products_stock((int)$_GET['products_id']) <0) {
    $zc_stock_level_image = '<span class="Arrivo">Esaurito</span>';
    }

    else {
    $zc_stock_level_image = '<span class="Esaurito">In arrivo</span>';
    }
    echo '<b class="Stock">Stock Level: </b>' . $zc_stock_level_image;
    ?>
    But i miss the part

    if ($flag_show_product_info_quantity == 1 ...........
    Where should I add it?

    Thanks a lot for your help :)

  4. #4
    Join Date
    Oct 2006
    Posts
    624
    Plugin Contributions
    0

    Default Re: Stock Level Indicator in Product Info Page

    Assuming your product type is Product-General, then look inside:

    /includes/templates/template_default/templates/tpl_product_info_display.php.

    Make changes to the file according to Kuroi's instructions as follows.

    Delete the line:

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

    PHP Code:
    <?php if ($flag_show_product_info_quantity == && $products_quantity >= 1) echo '<li>Available</li>'?>
    Do remember to use the overrides for your changes. You may also want to look at the following mod if you want the same functionality to apply to your product listings as well.
    Goh Koon Hoek, author of "e-Start Your Web Store with Zen Cart".
    Printed book: www.lulu.com/content/10576284
    Electronic book and Errata: www.cucumbermedia.com/store

 

 

Similar Threads

  1. Compare Multiple Products/Stock Level Indicator
    By dinix in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 12 Feb 2012, 02:42 AM
  2. Stock Level Indicator installation
    By orien in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 9 Aug 2010, 11:14 AM
  3. traffic light stock level indicator
    By modchipfitters.co.uk in forum Templates, Stylesheets, Page Layout
    Replies: 32
    Last Post: 13 Nov 2009, 11:11 PM
  4. Stock level indicator, for stock by attributes controller
    By vandiermen in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 13 Nov 2008, 09:49 AM
  5. product page stock level indicator
    By dscott1966 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 1 Oct 2008, 04:28 AM

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