Einfache Smarty Frage

Hallo, ich habe eine einfache Frage für die Smarty Cracks.

Ich versuche eine einfache Selectbox aus dem Amount feld in der Detailansicht zu machen.

Dabei sollen maximal 10 ausgewählt werden können und bzw die maximale Anzahl im Stock.
Er Iteriert schon brav aber ich weiss nicht wie ich den aktuellen Index azeigen kann.

mein Code:

[{ if $product->isBuyable() }]

    [{ section name=amount start=1 max=10 loop=$product->oxarticles__oxstock->value}]
		    [{$oSmarty.section.amount.index}]
[{/section}]

[{/if}]

Vielen Dank für eure Hilfe

wär super wenn mir wer mit dem smarty loop helfen könnte

Dieses Script fliegt mir mit nem smartyerror um die ohren.

Was mach ich falsch bei dem Smarty loop?

<select id=“test_AmountToBasket” name=“am”>
[{section name=amount start=1 loop=$product->oxarticles__oxstock->value}]
<option value="[{$smarty.section.amount.index}]" [{if [{$smarty.section.amount.index}] == 1}] selected[{/if}]>[{$smarty.section.amount.index}]</option>
[{/section}]
</select>

Sorry, da muss ich passen.

Vielleicht besser hier mal fragen?
http://www.phpinsider.com/smarty-forum/


Marco Steinhäuser
Community Guide
OXID eSales AG

Was heißt es fliegt dir um die Ohren? Welche Fehlermeldung bekommst du? Wo liegt der Fehler? Hast du es zuerst mal mit statischen Werten versucht und ohne die Variablen?

LG Caro

http://www.andro-shop.com Oxid PE 4.0.1