In most cases, we recommend to use the available Buy Box blocks which have "Cart" and "Checkout" button destination options built-in. Using these blocks, you can easily set them up so that when a page visitor clicks on them, it will add the product to the Cart or Checkout on your store. 

If you're using a non-Buy Box block, then you can set the "button destination" to URL and use a Cart or Checkout permalink to mimic an "Add To Cart" or "Add To Checkout" button using the information below. 

Add to Checkout:

Important Note: Direct to checkout links only work for the Shopify checkout. These will not work for the OCU checkout which is why we show the Cart option as well. Use the Cart option for products you've applied an OCU upsell tag to.

URL structure to add 1 product to the Checkout:

yourstore.myshopify.com/cart/1234567890:1

Where 1234567890 is the product's Variant ID and 1 is the quantity.

URL structure to add multiple products to the Checkout:

yourstore.myshopify.com/cart/1234567890:1,0987654321:1 

Note: You can enter a different quantity for each product's Variant ID in the URL string above.

URL structure to add a Discount code to the Checkout along with the product(s):

yourstore.myshopify.com/cart/1234567890:1?discount=YourDiscountCode 

Where you append the URL string with ?discount= then enter your Shopify discount code you want auto-applied. 

URL structure to add a product to the Checkout that is only visible to the Buy Button sales channel within your store:

yourstore.myshopify.com/cart/1234567890:1?channel=buy_button

Where you append the URL string with ?channel= then enter the Sales Channel that this product is visible to, in this case buy_button

Add to Cart:

URL structure to add 1 product to the Cart:

yourstore.myshopify.com/cart/add?id=1234567890&quantity=1

Where 1234567890 is the product's Variant ID and 1 is the quantity. 

URL structure to add multiple products to the Cart:

yourstore.myshopify.com/cart/add?id[]=1234567890&id[]=0987654321&quantity=1 

Note: Notice the use of [] in the URL string above. You can't apply different quantities for each product Variant ID. The quantity used at the end of the url above will be applied to ALL product Variant IDs added to the URL string. 

Finding the Shopify Variant ID:

  1. Go to the product detail page for the item you want to find the ID for.
  2. At the end of the URL there, enter .xml and press enter.
  3. The Shopify Variant ID you will need can be found as shown below:

Did this answer your question?