I have different view blocks that display multiple products on the same page, each product has their own attributes such as product bundle and custom line item, these serves as an option set / criteria of the main product. The results of the options slider will be the value of the customs line item that is hidden.
What I plan to accomplish is to add all these selected products with the selected attributes on the cart at the same time with just one button.
These are the methods/modules I have tried:
- VBO + Rules : https://www.drupal.org/node/1468392#comment-10270105
- Commerce Add to Cart Extras
- Commerce Ajax Add to Cart + Jquery : Looping through all selected products then clicking the add to cart button by jquery. It works but not that great because sometimes some of the products are not being added. Maybe because of all the ajax request running at the same time?
The first two methods work for the main product only, no attributes of the customs line item and bundle products. I tried including the add to cart form in the view with the VBO or commerce product: quantity field of commerce add to cart extras but it doesn't work maybe because it's a form within a form.
Does anyone have any suggestion on how to make this work?
Thank you in advance!