Smarty iteration: is there a similar function when not in a foreach loop?

Posted by Kyle Sevenoaks on Stack Overflow See other posts from Stack Overflow or by Kyle Sevenoaks
Published on 2010-06-15T09:35:33Z Indexed on 2010/06/15 9:42 UTC
Read the original article Hit count: 222

Filed under:
|
|
|

Hi, I'm trying to add a JS fly to basket plugin to the site I'm working on, but the plugin needs unique productID numbers, is there a way to iterate this in Smarty when not in a foreach loop? Something like: {$smarty.foreach.foo.iteration}

Here's the code I need to itrate:

<span id="slidingProd57404045">
 <a href="{link controller=order action=addToCart id=$product.ID returnPath=true}" rel="nofollow" class="addToCart" title="Bestill"
  onclick="addToBasket(57404045); return false;" id="fly_to_basket">&nbsp;</a>
</span>

The 57404045 needs to be iterated.

Thanks.

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript