Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
is there a simple way to add multiple products to the basket in one call, without creating a bundle?
I want to give the option to select one or more add-on products as shown in the red square below. The products will vary by product category and will change from time to time.
Just wondering if there's a tried and tested way to do this before I dig into it myself.
Actually looking into this, perhaps creating a bundle is the way to do this. My only concern is the grouping of products so if someone added a few items and selected the add on under one of them then later removed the parent product they may remove the add-on product without realising.
I'll investigate further,
You should be able to use the HTML API to add multiple products at the same time. To do so you can follow closely the bundle example, but just miss out the bundle parts.
<form method="post" action="/base/TC/FormPost.aspx">
<input name="AddOrUpdateOrderLine" value="productIdentifier : productIdentifier_1, quantity : quantity_1" type="hidden" />
<input name="AddOrUpdateOrderLine" value="productIdentifier : productIdentifier_2, quantity : quantity_2" type="hidden" />
<input name="storeId" value="1" type="hidden" />
<input name="productIdentifier_1" value="1072" type="hidden" />
<input name="productIdentifier_2" value="1073" type="hidden" />
<input name="quantity_1" value="1" type="text" />
<input name="quantity_2" value="2" type="text" />
<input value="Add products" type="submit" />
They key is to add multiple input fields, and use the AddOrUpdateOrderLine mapping API to map to specific input fields for each item being added.
brilliant, thanks Matt
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted