less than a minute read • Updated 3 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.
- 1- In the Foxy admin, go to the Sample Code page here . 
 
- 2- On the Sample Code page, copy the code snippet from Step 1. 
 
- 3- In the SpaceCraft dashboard, click on the Developer icon at top. 
 
- 4- Under Developer Tools, click on the "Body JS" link. 
 
- 5- Paste the Foxy code snippet into the code editor. 
 
- 6- Click 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.
- 1- Click on the "Content" link at top. 
 
- 2- Click on the "Add New Pages" button. 
 
- 3- From the list of page types, choose "Products". 
 
- 4- Click 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.
- 1- From the Products page, click on the "Add A product" button. 
 
- 2- Fill out your product information. 
 
- 3- Below the Price block, click on the plus sign icon to add a new block. 
 
- 4- Choose the "Button" option. 
 
- 5- In the Foxy admin, go to the Sample Code page here . 
 
- 6- On the Sample Code page, copy the "href" value from the link example in Step 2 section. 
 
- 7- In 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 . 
 
- 8- Specify your button text. 
 
- 9- Publish your changes and test to ensure purchase button works as expected. 
 
- 10- Repeat steps for each additional product.