Make "Add to cart" go straight to checkout

Topic summary

A user wants to redirect customers directly to checkout when clicking “Add to cart” on their single-product store to reduce friction.

Proposed Solution:

  • Modify the add to cart button to an anchor tag with a specific URL structure
  • Replace placeholders with actual shop URL, variant ID, quantity, and selling plan ID (for subscriptions)
  • Code example provided:
https://{SHOP}.myshopify.com/cart/items[id]={VARIANT_ID}&items[quantity]={QUANTITY}&items[selling_plan]={SELLING_PLAN_ID}?return_to=/checkout

Key Considerations:

  • Works best for stores with few unrelated products or when customers don’t need to buy multiple items
  • Remove selling_plan parameter if not selling subscriptions

Open Issues:

  • One user asks if this can be applied to collections instead of individual products
  • Another reports an error when using selling_plan: “Expected String to be an Integer”
  • A YouTube tutorial link was shared as an alternative working solution

The discussion remains ongoing with implementation questions unresolved.

Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

Id like it so that when people click on add to cart, they would then be redirected directly to the checkout page. Is this a good idea for a one product store? Im thinking it would provide less friction.

P.S - Im using the refresh theme

If you sell only a few different products and they’re not very related to each other, or you don’t need the customer to purchase multiple items at once, then redirecting the customer directly to the checkout can be a good idea to reduce the friction as you said. Nothing wrong with that.

You can achieve it by making the add to cart button an anchor tag and setting the href property to this:

https://{SHOP}.myshopify.com/cart/clear?return_to=/cart/add?items[][id]={VARIANT_ID}%26items[][quantity]={QUANTITY}%26items[][selling_plan]={SELLING_PLAN_ID}%26return_to=/checkout

Replace SHOP with your shop url, VARIANT_ID with the ID of the selected product variant, QUANTITY with selected quantity. SELLING_PLAN_ID is for when you want to sell the item as a subscription. If you’re not, then you can remove the:

items[][selling_plan]={SELLING_PLAN_ID}%26

Is there a way to do this for a store with more items? Can you give me a code for doing this for collections instead of individual products?

This doesn’t appear to work with selling_plan. When redirected Shopify will show the error “expected String to be a Integer: selling_plan: expected String to be a Integer: selling_plan”

Not my content, but this guy’s solution worked for me.

https://www.youtube.com/watch?v=AMtadMQLqUE&ab_channel=JahinShahriar