Code Samples | Product Multi-Add As Attributes
This code allows you to have a single add to cart button on the product page add multiple products to the cart. The products are called in from a custom
field as a comma separated list and are displayed on the PROD page as an upsell or attribute.
- Create Custom Product Field with code of "add_on_product". This will be used to store a comma seperated list of product codes you want to display
- Add the code in multi_add_attributes.html right below the product attributes item in PROD
- Add JS to page, make sure to add the id of "AddToCart" to the PROD page form.
- Modify the action on the page to ADMP and set the inputs for Quantity and Product_Code to be Products:Code and Products:Quantity
When added to cart, 2 items are added. The JS keeps the quantities in sync.
ADMP, Multi-Add, Attributes