View Single Post
  #3  
Old 08-14-2005, 01:10 PM
 
gfiebich gfiebich is offline
 

Senior Member
  
Join Date: Feb 2003
Location: St. Paul, MN
Posts: 108
 

Default

Mr. Stillwell-

Thanks for posting that nice little mod - it was (almost) exactly what I was looking for! I've tweaked it slightly to display the inventory level for each variant. My modification also displays the table on items without variants - something I wanted for product display consistency.

Note that my code will display inventory levels for variants or basic items regardless of the status of "Disable inventory tracking" in the admin. For the site I'm working on, we have this option checked - allowing customers to backorder items.

(this was done on x-cart gold 4.0.14)

-Glen

Code:
{if $variants} <table cellspacing="1" cellpadding="0" border="0" class="chart" width="75%"> <tr class="chart_head"> <td>{$lng.lbl_sku}</td> <td>{$lng.lbl_description}</td> <td>{$lng.lbl_inventory}</td> <td>{$lng.lbl_our_price}</td> </tr> {section name=test loop=$variants} <tr class="{cycle values="chart_dark,chart_light"}"> <td>{$variants[test].productcode}</td> {foreach item=item key=key from=$variants[test].options} <td>{$item.option_name}</td> {/foreach} <td>{if $variants[test].avail < 1}0{else}{$variants[test].avail}{/if}</td> <td>${$variants[test].price}</td> </tr> {/section} </table> {else} <table cellspacing="1" cellpadding="0" border="0" class="chart" width="75%"> <tr class="chart_head"> <td>{$lng.lbl_sku}</td> <td>{$lng.lbl_inventory}</td> <td>{$lng.lbl_our_price}</td> </tr> <tr class="{cycle values="chart_dark,chart_light"}"> <td>{$product.productcode}</td> <td>{if $product.avail < 1}0{else}{$product.avail}{/if}</td> <td>${$product.price}</td> </tr> </table> {/if}
__________________
NO LONGER USING X-CART - NOT ACTIVE IN THESE FORUMS
Reply With Quote