less than a minute read • Updated 2 years ago
Add an Uploadcare file upload option to product form
Configure Uploadcare Widget
Create your free Uploadcare account here.
Create you first Project in Uploadcare here.
From the Get Started page, select File Uploader under the Integrate Uploading section.
Customize your upload widget following Step 1 and Step 2.
Add Widget to Product Form
In your website (or the page where your Foxy product will reside), paste the snippet below right before the closing HEAD tag.
<script src="https://ucarecdn.com/libs/widget/3.x/uploadcare.full.min.js"></script>
Go back to your Uploadcare widget settings and copy the form input HTML from Step 4.
Paste the form input HTML into your Foxy product form.
Add the "name" parameter to the file input HTML (ex: name="Upload"). The name value can be changed to anything you want. Your Foxy product form HTML should look similar to this:
<form action="https://YOUR_SUBDOMAIN.foxycart.com/cart" method="post" accept-charset="utf-8"> <input type="hidden" name="name" value="My Product" /> <input type="hidden" name="price" value="10" /> <input type="hidden" role="uploadcare-uploader" data-public-key="YOUR_PUBLIC_KEY" data-system-dialog="true" name="Upload" /> <input type="submit" value="Add To Cart" class="submit" /></form>
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.