![]() |
Numbering in Bestseller
What I trying to achieve is to add a simple counter such that it will label bestseller column in such a form.
1. A product 2. B product 3. C product . . . Anyone knows how to create a simple counter for .tpl file? {* $Id: bestsellers.tpl,v 1.8.2.1 2006/11/16 13:12:29 max Exp $ *} {if $bestsellers} {capture name=bestsellers} <table cellpadding="0" cellspacing="2"> {foreach from=$bestsellers item=bestseller} <tr> {if $config.Bestsellers.bestsellers_thumbnails eq "Y"} <td width="30"> <a href="product.php?productid={$bestseller.productid }&cat={$cat}&bestseller">{include file="product_thumbnail.tpl" productid=$bestseller.productid image_x=90 product=$bestseller.product}</a> </td> {/if} <td> <b><a href="product.php?productid={$bestseller.productid }&cat={$cat}&bestseller">{$bestseller.prod uct}</a></b><br /> {$lng.lbl_our_price}: {include file="currency.tpl" value=$bestseller.taxed_price}<br /> </td> </tr> {/foreach} </table> {/capture} {include file="dialog.tpl" title=$lng.lbl_bestsellers content=$smarty.capture.bestsellers extra='width="100%"'} {/if} |
Re: Numbering in Bestseller
hi yamiya,
You can either add a name to the foreach and count the iterations like so... {foreach from=$bestsellers item=bestseller name=thisloop} {$smarty.foreach.thisloop.iteration}. {/foreach} or you could use {counter}. Hope this helps. |
Re: Numbering in Bestseller
many thanks. it's working seamlessly now :D
http://www.yamiya.com.my Quote:
|
All times are GMT -8. The time now is 09:03 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.