less than a minute read • Updated 2 years ago
Create a purchase button in Squarespace
In this article we show you how to add a simple purchase button to your Squarespace website.
Add Foxy Code Snippet
To display the sidecart when a customer adds a product to cart and store customer sessions, you must first load the needed Foxy loader file into your Squarespace website.
1In Squarespace, click on "Settings".
2Click on "Advanced" under the Website column.
3Click on "Code Injection".
4In the FoxyCart admin, go to the Sample Code page here and copy the snippet of code from Step 1.
5In Squarespace, paste snippet of code into Footer section.
Add Purchase Option
Any Squarespace element that can be linked can be used as your purchase option.
1In Squarespace, click on "Pages" and choose page you want to add purchase option to
2Click on "Edit" to edit page content
3Add a button element and style it to your liking
4In the Foxy admin, copy the "href" value from the link example in Step 2 section
5In Squarespace, paste the copied link into the "Link" field
6Modify the product parameters as needed
7Apply changes and save settings
Display Product Image In Cart
You can display the product image in the cart by passing in the image url as a product parameter.
1Switch to view mode and right-click on your product image
2From the right-click menu choose "Copy Image Address"
3Switch back to edit mode and click to edit your button element
4Click to modify the "Link" field
5At the end of your "Link", add &image=
6Paste the image address you just copied right after the equal sign
7Apply changes and save settings