View Single Post
  #2  
Old 01-24-2013, 03:19 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: How to replace quantity in stock with stock indicator

You can do this with smarty

file:
/skin/common_files/customer/main/product_details.tpl
(or whatever template file you use for product_details.tpl for your skin)

FIND this code:
Code:
{if $config.Appearance.show_in_stock eq "Y" and $config.General.unlimited_products ne "Y" and $product.distribution eq ""} <tr> <td class="property-name">{$lng.lbl_in_stock}</td> <td class="property-value product-quantity-text" colspan="2"> {if $product.avail gt 0} {$lng.txt_items_available|substitute:"items":$product.avail}

And replace:
Code:
{if $product.avail gt 0} {$lng.txt_items_available|substitute:"items":$product.avail}
with:
{if $product.avail gt 0 and $product.avail lt 4}
<img src="RED_BAR.gif" />
{elseif $product.avail etc....
etc...
{/if}

use smarty to trap for number in stock and display the color bar. This shouldn't take you more than a few minutes to code it.

Yes?
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote