arthurbinz Posted November 30, 2009 Share Posted November 30, 2009 Bonjour,Depuis ma prise en main de PS je cherche une solution pour forcer le client à choisir sa taille. Information nécessaire dans bien des domaines. Dans mon cas GROUPE = TAILLES et ATTRIBUT = du 38 au 50 + "Choisir" et avec pour valeur par defaut -> "Choisir"J’ai fini par trouver une solution dans le fichier prestashop\modules\blockcart\ajax-cart.js ligne 136 afin d'afficher une alert JAVASCRIPT (si taille = choisir afficher l’alert)// add a product in the cart via ajaxadd : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, whishlist){// ajout pour vérificationvar elementVal = document.getElementById('group_6'); //group_6 pour moivar elementTxt = elementVal.options[elementVal.selectedIndex].text;if(elementTxt == 'Choisir'){alert('Merci de spécifier votre TAILLE');return ;}// fin ajoutIl me faut trouver comment remplacer ‘group_6 ‘ par la variable le but étant de trouver le motif "Choisir"Si ça peut aider certains... 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