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