Jump to content

Tasti + e - quantità prodotto


paz2013

Recommended Posts

Buongiorno a tutti,


uso PrestaShop 1.5.4.1. Esiste qualche modulo che ti dia la possibilità di inserire i tasto + e - affianco la quantità nella pagina di dettaglio del prodotto? Attualmente col tema di base di PrestaShop ti fa inserire manualmente la quantità.


 


Esempio:


+.jpg


 


Grazie anticipatamente


Un saluto


D.


Link to comment
Share on other sites

Ho risolto aggiungendo questo codice a product.tpl

<!-- quantity wanted -->
   <p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
    {literal}
	 <script type="text/javascript">
	  $(document).ready(function(){
	   $('#quantity_wanted').val(1);
	   $('.qty_up img').on('click',function(){
	    if (isNaN(parseInt($('#quantity_wanted').val()))){$('#quantity_wanted').val(1);}
	    else {$('#quantity_wanted').val(parseInt($('#quantity_wanted').val())+1);}
	   });
	   $('.qty_down img').on('click',function(){
	    if (isNaN(parseInt($('#quantity_wanted').val()))){$('#quantity_wanted').val(1);}
	    else {  if(parseInt($('#quantity_wanted').val())<=1){  }
		  else {$('#quantity_wanted').val(parseInt($('#quantity_wanted').val())-1);[spam-filter]
	   });
	  });
	 </script>
    {/literal}
    <label>
	 {l s='Quantity:'}
    </label>
    <span class="qty_down floatleft">
	 <img src="{$img_dir}/minus.jpg" width="12" height="12" alt="" title="" />
    </span>
    <input
	  type="text"
	  name="qty"
	  id="quantity_wanted"
	  class="text"
	  value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}"
	  size="2"
	  maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} />
    <span class="qty_up floatleft">
	 <img src="{$img_dir}/plus.jpg" width="12" height="12" alt="" title="" />
    </span>
   </p> 

Ciao

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...