Jump to content

Add multiple items with one "Add to Cart" button.


Recommended Posts

Have you change code like in posts #5 and #9

in the module blockcart, file ajax-cart.js
ajaxCart.add(idProduct, null, false, this);

Replace with

ajaxCart.add(idProduct, null, false, this, $('#quantity_wanted_'+idProduct).val()); 

Link to comment
Share on other sites


I tried those changes, they don't work. To be clear, what I am trying to do is, replace this:

Product A -- Quantity a [Add to cart]
Product B -- Quantity b [Add to cart]
Product C -- Quantity c [Add to cart]


Product A -- Quantity a
Product B -- Quantity b
Product C -- Quantity c

[Add to cart]

I will have to create an "Add to Cart" button outside the foreach loop, and on clicking it somehow add the quantities from the text boxes above into the cart...


Link to comment
Share on other sites

I tried with some jQuery to emulate clicks on Add to cart buttons but that didn't worked correctly.
It adds one product quantity OK but for other sometimes double and sometimes random, do not know why.

Here is what I tried maybe it helps.
First I edit classes so that button after list have class .addall and code is



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...