January 10, 2022
Emmanuel Umukoro

If you are a Shopify store owner looking to build a link that will lead shoppers directly to your cart page along with their selected items preloading into their carts, then this is for you! 

A cart permalink is required to establish a Shopify add-to-cart link. This may be a bit sophisticated for some Shopify users, but it should come easy if you are familiar with JavaScript, Liquid CSS, and HTML. However, let's look at the simplest approach to establishing a Shopify add-to-cart link.


Your store’s add to cart URL will look like this:

1. Rename "YOURSTORENAMEHERE" in the above link with your actual store name or  “” with your website URL.

2. Replace VARIANTID with the ID of your product variant.

3. Replace "1" with the quantity of product you wish to add to the cart.

4. If you want to add different products and quantities to the cart:

5. Edit "VARIANTID1" and "VARIANTID2," and the quantity in each case.


While the first approach works just fine, there is a second and noteworthy approach that some Shopify store owners also use to create add-to-cart links. In this case, you will need to use a cart permalink. 

Cart permalink is the solution if you want to link straight to the Shopify checkout screen with a specific cart that already has products in it.  It is also the solution if you are seeking to add a "Buy it now" button in your newsletters or blogs?

So, what are Cart permalinks? Cart permalinks are pre-built links that allow users to instantly access checkout or a shopping cart. These permalinks are best suited for apps that allow customers to buy things from a single merchant in a cart.

Here's an example of a cart permalink:,70881382:1

Its URL format will look like this:{variant_id}:#{quantity}(, ...)

How to append Checkout parameters and cart

Pre-filling any of the checkout fields is as easy as appending checkout query parameters to the URL of the cart permalink. When appending checkout parameters, use the format below:{variant_id}:{quantity}?checkout[email][shipping_address][city]=thisismyhometown

The [email] here stands for any of the form's possible checkout fields, while The [shipping address][city], demonstrates how to use nesting to populate child fields.

Here is a list of checkout parameters that you can prefill

Checkout Parameters Description
checkout[email] Email of the customer
checkout[shipping_address][first_name] Address [first_name]
checkout[shipping_address][last_name] Address [last_name]
checkout[shipping_address][address1] Address [address1]
checkout[shipping_address][city] Address [city]
checkout[shipping_address][zip] Address [zip]

How to discount variant ID

Beyond creating add-to-cart link, there are a few more hacks you can perform with this permalinks such as applying discount to a permalink directly. The discount format is as follows:


The string value of a discount code is used as the test part.

How to add one product to your cart with a discount


How to add two products to your cart with a discount


The number following the ":" represents the quantity selector. So you can replace '1' with the quantity you choose. You can also include tracking parameters as query parameters, add notes and cart attributes. If your store supports customer accounts and the user is not logged in, they will be directed to the login page before proceeding to checkout.

How to find product variant ID

1. Log in to your Shopify admin and navigate to Products > All Products.

2. Choose to a product that has variant.

3. Now choose one of the following options:

  • If you only have one store location, look out for the Variants section of the product detail page and cl ick the Edit icon next to the product variant.

  • If your store has various locations, select the product variant from the Variants section of the product detail page.

4. Take a look at the URL in the address bar of your browser. It should be comparable to:

The number following 'variants/' is the variation ID number


Cart abandonment is a major concern for all e-commerce store owners regardless of their hosting platform and one of its major causes is the lack of a direct add-to-cart link that will enable quick checkout for customers.

Creating this add-to-cart link for your store's cart will improve purchases and decrease cart abandonment. If you want to stay ahead of your competitors, add-to-cart might just be one of the final touches you need to add to improve your customers' experience.

Let's see what you build!

Book a Demo