Add-to-cart links are an alternative way for customers to add a product to their Rocketspark shopping cart.
The merchant first generates a link and shares that link via email marketing, social media or some other channel.
When the customer clicks the link.
- They are taken to the checkout page on the website
- The product is added to their cart (in addition to any products already in the cart)
- The link can also apply a coupon to the cart (optional)
- If the product no longer exists or is out of stock, an error message is shown.
How to generate an add-to-cart link
Generating links is currently a manual process. In the interest of making this feature available to merchants as quickly as possible, we have skipped building a user interface for generating add-to-cart links.
You will need:
- Your website URL e.g. https://www.example.com
- Note that this should be your actual domain name - the one that you give out to customers. Do not use the YOUR-SITE.rocketspark.co.nz domain name that you use while editing as this may not work for your customers.
- The Rocketspark product ID of the product you wish to add
- Go to the “Edit product” page for the product you wish to use
- The URL will be something like http://www.example.com/shop/product/12345678/Cocktail-Dress/
- The productID is the number inside this link after “shop/product”
- Note that if you have a Vend connected, these will have their own product IDs. These are different and are not the IDs you are looking for.
- (optional) The coupon code that you would like to include in the link. This is the same code that the customer would enter during checkout, eg “FEBSPECIAL”. Note that coupons are not available on all ecommerce plans.
Basic link format
https://www.example.com/shop/add/PRODUCTID/
- Replace PRODUCTID with your product ID noted earlier
A basic add-to-cart link is simply your domain name, followed by “/shop/add/” followed by the product ID of the product to add to the cart.
If a product has multiple variations (eg size, colour etc) the default variation will be added. This is the variation that has a black tick mark next to it on the Edit Product screen.
It is suggested starting with this basic example first and ensure it works before proceeding.
Specifying quantities (optional)
https://www.example.com/shop/add/2xPRODUCTID/
- Replace PRODUCTID with your product ID noted earlier, e.g. 12345678.
- Replace 2x with the quantity you would like, e.g. 3x for a quantity of 3.
This format is similar to the above, however add “2x” in front of the product ID to specify that a quantity of 2 will be added to the cart. Quantity can be any whole number and the usual stock checks will be done when adding the product to the cart.
If no quantity is specified, the default is 1x.
Specifying coupons (optional)
https://www.example.com/shop/add/PRODUCTID/COUPONCODE/
- Replace PRODUCTID with your product ID noted earlier.
- Replace COUPONCODE with your coupon code eg FEBSPECIAL or VIP20.
If you would like to have a specific coupon automatically applied to the cart at the same time, specify the coupon code as part of the link as per the above example.
The usual validity checks will be done, such as checking the expiry date and whether the product is eligible for coupons.
Only one coupon can be added to a cart at a time, so if multiple add-to-cart links are clicked, the coupon from the last link will apply.
Specifying product variation (advanced users)
https://www.example.com/shop/add/PRODUCTIDvVARIATIONID/
- Replace PRODUCTID with your product ID noted earlier.
- Replace VARIATIONID with your variation ID provided by Rocketspark, e.g. 87654321.
- Ensure that you place a v between your PRODUCTID and your VARIATIONID.
If your product has multiple variations (size, colour etc), it’s possible to specify which variation is added to the cart. However as the variation ID is not easily available, this is a feature that most merchants won’t be able to use.
Please contact our Customer Success team if you’d like us to provide the variationID for you to use in this link format.
Finding your VARIATIONID
To find your VARIATIONID, go into your product, select the variant you want, then right-click on the variant selector and select Inspect:
In the code that pops up, press CTRL+F or CMD+F and look for a section in the <input> tag that says variationID. The value attribute is your variant ID (in this case, 1006485).
Testing the link
Always test the link before publishing to ensure that it is set up correctly. It’s best to use a logged-out, incognito or private browser window to simulate what your customer will experience since your Rocketspark shop will work differently when you are logged in.
If the link format is correct, clicking the link should result in the browser being redirected to the checkout page with the correct product in the cart and the correct coupon applied (if using).
Ensure that coupon expiry dates are set appropriately if using a coupon and that product stock levels are enough to cover expected orders.
Ensure that you have a trailing slash at the end of your link. Without the trailing slash, the product will be added to your customers' cart twice.