Create an Add-To-Cart with Shopify

Last updated December 4, 2024

You have a Skin Match Technology Quiz from which you want to link directly to your store cart. Learn how to link to a pre-loaded cart.

Cart permalinks take customers directly to a store cart or checkout with a pre-loaded cart. When you generate a cart permalink, you direct customers who want to buy a specific product from your Skin Match Technology Quiz directly to your checkout to complete the purchase.

You can use cart permalinks to apply one or more variant IDs to a cart or checkout, or append query parameters to the cart permalink URL to include additional information and attribute an order to your sales channel.

Building a sales channel with permalinks requires the lowest integration effort because Skin Match Technology doesn't need to request payment processing, and sync orders, handle disputes, or manage refunds.

Step 1: Create a cart permalink

Add product variant IDs and quantities to the shop URL.

http://{shop}.myshopify.com/cart/#{variant_id}:#{quantity}(,...)

The following example adds one each of two products to the cart by specifying the product variant IDs (70881412) with a quantity of one 1:

http://{shop}.myshopify.com/cart/70881412:1

Step 2 (Optional): Apply discounts

You can append a discount query parameter to apply discounts in the cart permalink URL, as shown in the following example:

http://{shop}.myshopify.com/cart/70881412:1?discount={discount_code}

You can also append multiple discounts in the cart permalink URL, separated by a comma ,:

http://{shop}.myshopify.com/cart/70881412:1,70881382:1?discount={discount_code},{discount_code2}

Related Topics