24/7 Support: 800.608.6482

Get Started

Developer Docs

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.

Steps

  1. 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
  2. Add the code in multi_add_attributes.html right below the product attributes item in PROD
  3. Add JS to page, make sure to add the id of "AddToCart" to the PROD page form.
  4. Modify the action on the page to ADMP and set the inputs for Quantity and Product_Code to be Products[1]:Code and Products[1]:Quantity

Example:


When added to cart, 2 items are added. The JS keeps the quantities in sync.


Functions Used

Keywords

ADMP, Multi-Add, Attributes

Language

Template Language

Miva believes that all online businesses should have access to a scalable ecommerce platform that can meet their unique business requirements. Miva offers PCI compliant ecommerce, hosting, and custom website design and development solutions. Miva customers have processed over $100 billion in online sales since 1997.

Copyright © 2016 Miva, Inc - All Rights Reserved   Privacy Policy | Store Policy

Links
Contact Us
Receive Tips & Updates

Copyright © 2016 Miva, Inc - All Rights Reserved

Back To The Top