less than a minute read • Updated 2 years ago
Create a purchase button in SpaceCraft
In this article we'll show you how to use SpaceCraft's button block to create a Foxy purchase button.
Add Foxy Code Snippet
To display the sidecart when a customer adds a product to cart and to store customer sessions, Foxy's code snippet must be added to the footer of your SpaceCraft website.
1In the Foxy admin, go to the Sample Code page here .
2On the Sample Code page, copy the code snippet from Step 1.
3In the SpaceCraft dashboard, click on the Developer icon at top.
4Under Developer Tools, click on the "Body JS" link.
5Paste the Foxy code snippet into the code editor.
6Click on the "Save" button to save changes.
Create Products Page
If you haven't created your Products page yet, the following steps will show you how.
1Click on the "Content" link at top.
2Click on the "Add New Pages" button.
3From the list of page types, choose "Products".
4Click on the "Add" button to create the page.
Add Products
The following steps can be applied to any page type in SpaceCraft, not just products.
1From the Products page, click on the "Add A product" button.
2Fill out your product information.
3Below the Price block, click on the plus sign icon to add a new block.
4Choose the "Button" option.
5In the Foxy admin, go to the Sample Code page here .
6On the Sample Code page, copy the "href" value from the link example in Step 2 section.
7In SpaceCraft, paste the product link into the Button URL field and modify the product parameters as needed. You can learn more about product links here .
8Specify your button text.
9Publish your changes and test to ensure purchase button works as expected.
10Repeat steps for each additional product.