benscasi Posted January 27, 2010 Share Posted January 27, 2010 Bonjour,j'ai modifié l'affichage de certains produits possédant une couleur et une taille comme attributs. Lorsque je sélectionne une couleur, un tableau avec toutes les tailles se met a jour et permet de rentrer une quantité pour chaque taille(voir tableau).Je reussis a recuperer les valeurs avec javascript mais je voudrais savoir comment dire a ajax d'ajouter tous les produits en une seule fois. J'ai reperer le add dans ajax-cart.js mais je ne sais pas comment il est utilisé.Merci. Link to comment Share on other sites More sharing options...
benscasi Posted January 28, 2010 Author Share Posted January 28, 2010 Bonjour,je m'autoreponds puisque personne n'a d'idée. Je viens de comprendre le fonctionnement d'ajax notamment le fichier ajax-cart.js mais mes connaissances étant limitées en ajax, je voudrais savoir comment envoyer à la fonction add un tableau en paramètre avec la liste des combinaisons pour effectuer une boucle et envoyer plusieurs produits a la fois.Soit ici //for product page 'add' button... $('body#product p#add_to_cart input').unbind('click').click(function(){ ajaxCart.add( $('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null); return false; }); Soit ici // add a product in the cart via ajax add : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, whishlist){ alert('icicici'); if (addedFromProductPage && !checkCustomizations()) { alert(fieldRequired); return ; } //disabled the button when adding to do not double add if user double click if (addedFromProductPage) { $('body#product p#add_to_cart input').attr('disabled', 'disabled').removeClass('exclusive').addClass('exclusive_disabled'); $('.filled').removeClass('filled'); } else $('.ajax_add_to_cart_button').attr('disabled', 'disabled'); . . . Merci. Link to comment Share on other sites More sharing options...
benscasi Posted January 28, 2010 Author Share Posted January 28, 2010 Bonjour,c'est bon c'est resolu. Pour ce que ca interesse, j'ai recuperer mes valeurs et utilisé la fonction ajaxCart.add plusieurs fois avec mes paramètres. Link to comment Share on other sites More sharing options...
Tatafistula Posted January 28, 2010 Share Posted January 28, 2010 ça intéresse beaucoup de monde, mais pas les bonnes personnes... Trop difficile pour nous :-) 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