Skip to main content

Checkout with multiple products


Anchor to Add additional products from product pagesAdd additional products from product pages

You can include additional products alongside the main product when customers check out from a product page. If required, you can also nest related products under the main product. For example, nesting a warranty product under a TV.


Anchor to Limitations and considerationsLimitations and considerations

  • Adding multiple variants to the accelerated checkout from the product page is supported only on the online store. Custom storefronts don't support this feature.
  • The Buy with Prime wallet doesn't support adding more than one variant to the accelerated checkout from product pages. The wallet disregards additional items in the form.

Anchor to Step 1: Grab the product formStep 1: Grab the product form

Grab the product form from the product display page so you can add form fields for any additional variants you want to include.

The following example demonstrates how to attach hidden form elements to the form. It appends the additional item’s data to the form using the appropriate naming convention: shopify-additional-items[index][attribute].

Key requirements:

  • Index offset: Append additional items starting at index 1.
  • Parent linking: If you're nesting one or more additional items under the main product, then set the parent_id for each item to associate it with the main product in the cart.
<input type="hidden" name="shopify-additional-items[1][id]" value="20">
<input type="hidden" name="shopify-additional-items[1][parent_id]" value="25">

Anchor to Step 2: Set additional properties for form fieldsStep 2: Set additional properties for form fields

You can set the following properties for each additional form field:

Form keyDescription
shopify-additional-items[i][id]
required
The additional component variant ID.
shopify-additional-items[i][quantity]
optional
The quantity of the additional item. If not included, defaults to 1.
shopify-additional-items[i][parent_id]
optional
Links the nested item to the parent item.
shopify-additional-items[i][properties]
optional
The line item properties for the additional item.
shopify-additional-items[i][selling_plan]
optional
The selling plan id for the additional item.

Was this page helpful?