jeromecollection Posted January 24, 2019 Share Posted January 24, 2019 Bonsoir Je suis sous PS 1.6.1.17 Je viens de m'apercevoir que dans ma fiche produit, la quantité pouvant être ajouté au panier peut être illimitée En fait je voudrait que l'on ne puisse ajouter au panier que la qté maximum vraiment dispo . Mon stock est de 10 ... j'aimerai que le bouton + - puisse se bloquer a 10 et pas être en illimité pour qu'au final le client obtienne le message "Il n'y a pas assez de produits en stock." J'ai du toucher quelque chose, car d'origine Prestashop gère ce problème ... Merci d'avance pour votre aide https://www.jeromecollection.com/4171-samoa-billet-de-10-tala-champions-de-rugby-hongkong-sevens-2007-2008.html Link to comment Share on other sites More sharing options...
Mediacom87 Posted January 24, 2019 Share Posted January 24, 2019 Bonjour, comparez votre fichier product.js avec celui du template d'origine. Car cela est géré par ce code : // The button to increment the product value $(document).on('click', '.product_quantity_up', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!allowBuyWhenOutOfStock && quantityAvailable > 0) quantityAvailableT = quantityAvailable; else quantityAvailableT = 100000000; if (!isNaN(currentVal) && currentVal < quantityAvailableT) $('input[name='+fieldName+']').val(currentVal + 1).trigger('keyup'); else $('input[name='+fieldName+']').val(quantityAvailableT); $('#quantity_wanted').change(); }); // The button to decrement the product value $(document).on('click', '.product_quantity_down', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!isNaN(currentVal) && currentVal > 1) $('input[name='+fieldName+']').val(currentVal - 1).trigger('keyup'); else $('input[name='+fieldName+']').val(1); $('#quantity_wanted').change(); }); Link to comment Share on other sites More sharing options...
jeromecollection Posted January 25, 2019 Author Share Posted January 25, 2019 merci pour votre réponse, j'ai mis le fichier d'origine, vidé le cache ... cela ne change pas. J'ai regardé au niveau d'un override , mais rien de concluant ... je sèche Link to comment Share on other sites More sharing options...
jeromecollection Posted January 25, 2019 Author Share Posted January 25, 2019 Résolu dans la partie admin / Paramètres / Produits / Afficher les quantités disponibles sur la fiche produit -- oui miracle çà remarche ! 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