In this category Other topics

Other topics

Add products to the basket via a web address/URL

2 min read

On this page

Click a link, and the products are added to the basket.

For this to work, every product in your online shop must have a unique product number.

The web address consists of:

Domain name + /cart/add/batch/ + the product numbers of the products to be added, plus the quantity

https://webshopdemo.dk/cart/add/batch/100w4:1 (opens in a new tab)

100w4 is the product number and 1 is the quantity

For several products, separate the product numbers with commas:

https://webshopdemo.dk/cart/add/batch/100w4:10,60w4:1 (opens in a new tab)

Here it is 10 of product number 100w4 and 1 of product number 60w4.

Example 3: Reset the basket and add products

In examples 1 and 2, the products are added to whatever basket the customer may already have with products in it – every time the link is clicked.

That can of course be impractical if you need to recreate a basket and the customer already has some or all of it in the basket.

You solve this by adding ?reset to the web address, so the one from example 2 looks like this:

https://webshopdemo.dk/cart/add/batch/100w4:10,60w4:1?reset (opens in a new tab)

How to set/find the product number

Product numbers – also called Model/product no. in the shop's admin – can be found, for example, when you edit the product and go to the Data tab

Screenshot: How to set/find the product number (opens a larger image)

If it is a variant that should be added to the basket via a link, you need to use the product number shown on the variant

Screenshot: How to set/find the product number (opens a larger image)

You can also see product numbers in the product list, for example by choosing the view All products with prices

Screenshot: How to set/find the product number (opens a larger image)

Unique product numbers are important

To use this way of adding to the basket by product number, there must be only one product with the product number you give in the web address.

You can check for product numbers that are used more than once by choosing this view in the product list (for all products):

Screenshot: Unique product numbers are important (opens a larger image)