Skip to main content
All CollectionsFAQsCart + Checkout
How to divert the Add to Cart button to Checkout
How to divert the Add to Cart button to Checkout

This article provides the code snippet required to direct customers to checkout rather than the cart page

Connor Cherry avatar
Written by Connor Cherry
Updated over a week ago

The following customisation requires addition of code to your theme

Typically, when your customers have completed the bundle steps you've created they'll then press the "Add to cart" button. The native action then adds the customised bundle to the cart and loads the cart page.

If you would rather send the customer to the checkout page, you can achieve this by adding the following code to your theme:

window.bbAfterAddToCart = () => { window.location = '/checkout' }

You would need to add this piece of code to your theme (it can be added to all pages as it's refers specifically to Kitenzo and is therefore harmless outside of bundle page).

For example in layout/theme.liquid, they can add this above of </body> line:
​

<script>window.bbAfterAddToCart = () => { window.location = '/checkout' };</script>

Alternatively, you could redirect to the cart drawer. To do this, instead of window.location = '/checkout' you could target the cart drawer.

We would suggest looking at your theme code or working with your theme developer to understand any nuance when targeting other places such as the cart drawer.

If you require any assistance or clarification about this, please feel free to reach out to our Support team πŸ™‚

Did this answer your question?