bugg Posted January 20, 2015 Share Posted January 20, 2015 Bonjour, comment rajouter un bouton + ou - à côté de quantité dans la page produit, j'ai essayé ce qui est décrit sur prestarocket mais je n'y suis pas parvenue. je suis sous 1.5.6.2 Link to comment Share on other sites More sharing options...
Alexandre Carette Posted January 20, 2015 Share Posted January 20, 2015 il me semble que cette fonctionnalité est d'origine sur prestashop 1.5... je gere un site qui fait ca et il est en 1.5 Link to comment Share on other sites More sharing options...
bugg Posted January 21, 2015 Author Share Posted January 21, 2015 (edited) bonjour, il le fait sur la page commande, mais pas sur la page du produit, là il faut taper le chiffre selon quantité voulue... je suis parvenue à rajouter le + et -, mais quand on clique dessus, il ne se passe rien, je suppose qu'il faut modifier quelque chose dans product.js mais quoi.... Edited January 21, 2015 by bugg (see edit history) Link to comment Share on other sites More sharing options...
Alexandre Carette Posted January 21, 2015 Share Posted January 21, 2015 (edited) Essaye de mettre ca dans ton product.tpl voir si ca marche... avant <!-- minimal quantity wanted --> <!-- 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); $("#our_price_display").html(((productPrice*$("#quantity_wanted").val()).toFixed(2)+" "+currencySign).replace('.',','));} }); $('.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); $("#our_price_display").html(((productPrice*$("#quantity_wanted").val()).toFixed(2)+" "+currencySign).replace('.',','));[spam-filter] }); }); </script> {/literal} <span class="qty_down floatleft"> <img src="{$img_dir}minus.png" width="12" height="12" alt="Moins de produits" title="Moins de produits" /> </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.png" width="12" height="12" alt="Plus de produits" title="Plus de produits" /> </span></p> Edited January 21, 2015 by Alexandre-KM (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now