2 min read • Updated 2 years ago
Add an Uploadcare file upload field to checkout page
In this article we show you how to add a file upload option to your checkout page that will send files to your Uploadcare account.
Add Widget to Checkout Page
2Under the "Cart" section, turn on the "Add custom header and footer code to your templates" option.
3In the "custom header" text box, paste the code snippet below:
<script src="https://ucarecdn.com/libs/widget/3.x/uploadcare.min.js"></script>
4On the same Foxy settings page, under the "Checkout" section, turn on the "Add custom form fields to your checkout" option.
5Paste the code below into the "custom checkout fields" text box.
<div class="fc-form-group"> <div class="col-sm-8 col-sm-offset-3"> <div class="fc-input-group-container fc-input-group-container--checkbox fc-input-group-container--active"> <label class="fc-input-group-container__title fc-input-group-container__title--forced fc-form-label"> Upload Files </label> <div class="fc-form-group"> <p>Click the button below to upload your files.</p> PASTE_INPUT_FIELD_HTML_HERE </div> </div> </div></div>
6On the Uploadcare upload widget setup page, copy the form input HTML in Step 4.
7Go back to the Foxy settings page and replace "PASTE_INPUT_FIELD_HTML_HERE" with the HTML you just copied.
8Add the "name" parameter to the input HTML (ex: name="Upload"). The name value can be changed to anything you want.
9Save your template configuration settings by clicking the "Update" button at the bottom.
Final Results
If everything has been setup correctly, customers will see a new section on the checkout page where they can click to upload their files. Just like everything else in Foxy, the upload button and surrounding elements can be customized and styled with custom HTML and CSS.
Accessing Uploaded Files
A link to uploaded file(s) will be available in the receipt (both web and email) along with transaction details in the Foxy admin here.