2016-04-12 8 views

Antwort

0

Verwendung HTML5 input type "number"

Bitte überprüfen Sie für alle Browser es vor live schalten.

1

gehen, app \ Design \ Frontend \ default \ your_theme \ template \ catalog \ Produkt \ view \ addtocart.phml

Gegen Linie keine 32-Suche,

<label for="qty"><?php echo $this->__('Qty:') ?></label> <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />

ersetzen die oben mit,

<div> <label for="qty"><?php echo $this->__('Qty:') ?></label> <input class="button-arrow button-up" type="button" value='+'></input> <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" /> <input class="button-arrow button-down" type="button" value='-'></input> </div>

Am Ende dieser Datei .phtml Paste

<script type="text/javascript"> //&lt;![CDATA[ jQuery(function($) { $('.add-to-cart .button-up').click(function() { $qty = $(this).parent().find('.qty'); qty = parseInt($qty.val()) + 1; $qty.val(qty); }); $('.add-to-cart .button-down').click(function() { $qty = $(this).parent().find('.qty'); qty = parseInt($qty.val()) - 1; if (qty < 0) qty = 0; $qty.val(qty); }); }); //]]&gt; </script>

+0

Ehrfürchtig, das hatte funktioniert! Danke! – soy

+0

Sie sind herzlich willkommen :) –

+0

Ich bin auch mit dem Hinzufügen in Top-Links kämpfen, die Optionen, die ich benötige, ist Mein Konto Mein Warenkorb Checkout anmelden. Ich brauche es in der Zeile anzuzeigen, die auch dynamisch sein muss, wenn Sie loggen in – soy