In this article we'll show you how to use Carrd's form builder to create a Foxy purchase form.
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 a hidden embed element in your Carrd website.
- In the Foxy dashboard, go to the Sample Code page.
- On the Sample Code page, copy the snippet of code from Step 1.
- In Carrd, click on the "Add an element" icon.
- From the elements menu, click on the "Embed" option.
- In the Embed panel, set the "Style" to "Hidden".
- Paste the snippet of code you just copied into the "Code" field.
- Click on the "Done" button to save your changes.
Create Form
- In Carrd, click on the "Add an element" icon.
- From the elements menu, click on the "Form" option to add a new form.
- In the Form panel, change the "Type" to "Custom".
- Change "Send Email" to "Send to URL".
- Go to the Foxy Sample Code page to get your form action url.
- From the Step 2 section, copy the form example action value.
- In Carrd, paste the url you just copied into the "URL" field.
- Change the "Method" to "Post".
- Scroll up and click on the "Fields" tab. (This is where you can add your form's visible and hidden fields. Your purchase form must contain at minimum the product name and price .)
- Add product parameters that aren't customizable by the customer to the "Hidden Values" section. (ex: name and price)
- Create visible fields for product parameters that are customizable by the customer.
- Scroll up and click on the "Button" tab. (This is where you can change your form button's label.)
- Modify your button label as desired.
- Click on the "Done" button to save your changes.
- Test your purchase form to ensure it works as expected.