All lives can’t matter until black lives matter. (2024)

How do I make one product go directly to checkout in Squarespace?

I was tasked with this goal recently: with Squarespace Commerce have the entire site use the shopping cart EXCEPT for one product which should go directly to checkout (known as "Express Checkout" in Squarespace).

While I didn't find a way to do it per-product I did find a way to do it per-page.

The catch is that if you are using a public Store page it will not work on the index view. However, it can work on the detail page or if you are adding your product to a regular page using a Product block.

Here is the code you'll need to add:

<script>
// make entire page use "express checkout" (no cart)
Static.SQUARESPACE_CONTEXT.websiteSettings.storeSettings.expressCheckout = true;
</script>

If using a public Store page

Add the above code in a Code block in the product's Additional Info area found by editing the product in your Inventory.

If using a Product block

On the Page Settings for the page that has the Product block go to Advanced and add the code in the Page Header Code Injection field.

In either case if the script is added you should see the Add to Cart button change to Purchase.

Notes

  • This will affect ALL products on the page.
  • Of course this can also be done conditionally with more advanced JavaScript. For example, invoke the script if a certain product is found on the current page.
  • Currently this is only tested on Squarespace 7.0, but it might work on 7.1 as well.

Have a question or comment about this post, or just want to say hi? Drop me a line


Earlier Post: The wonderful stupidity of Mini Habits

Later Post: Automatically add “View Event” buttons to a Squarespace 7.1 Events page

All Posts