Shopify themes, liquid, logos, and UX
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"
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024