Currently, pressing the AddToCart button opens the cart.
However, I'd like the AddToCart button on my product page to directly link to the checkout page (the page where the customer fills in his/her address information).
I tried several suggestions from this page https://community.shopify.com/c/Shopify-Discussion/SOLVED-How-can-I-skip-the-cart-and-go-straight-to...
However, none of them work for me.
Could someone tell me how to get this to work in the Boundless theme?
Thanks in advance.
Solved! Go to the solution
Hello, @mimport .
Elias here with Shopify Support. Thank you for this inquiry.
I understand you would like to have the add to cart button go directly to the checkout. The accelerated checkout or dynamic checkout can save your customer’s information and allow returning customers to checkout more quickly. Depending on the accelerated checkout method, some can use dynamic checkout, which will allow your customers to skip the cart and go straight to the checkout. This method will allow you to consider hiding the cart icon and/or the add to cart button, giving you the same effect as a direct checkout. Nonetheless, this will affect your customers’ ability to add multiple items to their cart and may impact your sales. That said, is there a specific reason you don't want the cart?
If you're interested you can enable the dynamic checkout button by going to the Storefront editor (Online Store > Themes > Customize) , then navigating to the product page. Here's a screenshot for enabling dynamic checkout button on the Boundless theme:
If you prefer to modify the add to cart button to go straight to checkout, this will require significant modification to your theme’s coding. However, this level of customization does fall outside our design policy. For this reason, I recommend checking with a developer or Shopify Experts as they are best equipped to assist with custom coding.
I hope this provides a couple suggestions for you to explore. If you have any other questions on this topic, don’t hesitate to let me know in this thread.
Elias | Social Care @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
This is an accepted solution.
Hi @mimport
For that you have to made changes in Js file.
1. Open Asset-> theme.js.liquid file and find '/cart/add.js' and then add this line(location.href='/checkout';) in to success function next to this line
also comment 'callback(line_item, form);'
So it look like:
var params = { type: 'POST', url: '/cart/add.js', data: jQuery(form).serialize(), dataType: 'json', success: function(line_item) { if ((typeof callback) === 'function') { location.href='/checkout'; //callback(line_item, form); } else { Shopify.onItemAdded(line_item, form); } }, error: function(XMLHttpRequest, textStatus) { if ((typeof errorCallback) === 'function') { errorCallback(XMLHttpRequest, textStatus); } else { Shopify.onError(XMLHttpRequest, textStatus); } } };
User | Count |
---|---|
542 | |
209 | |
126 | |
79 | |
44 |