Short answer: Squarespace’s Add to Cart forms (product forms) don’t have a file upload field. Every field saves a short text answer on the order line item, and none of them accepts a file. You don’t need the form to collect one, though: CartDocket puts an uploader on the product page, just above Add to Cart, and attaches each file to its order and line item. If a product already has a form, the uploader appears inside it. No Text field is needed either way.
How Squarespace Add to Cart forms work
You attach a form to a product, and shoppers fill it in when they add that product to their cart. On Squarespace (7.1 and 7.0) the form usually opens after the shopper clicks Add to Cart, and the item only goes into the cart once the required fields are filled in.
Each answer is saved with that line of the order. You see the answers on the order in Squarespace, and apps can read them through the
Squarespace Orders API, where every line item carries a customizations list of label and value pairs, such as
{ label: "Engraving", value: "Love, Sam" }. Because answers belong to a line item, two of the same product in one
cart keep their own answers.
Why there’s no file upload field
A form answer is a short piece of text; a file is not. Accepting files means storing them, limiting their size, checking they’re safe, keeping them private and deleting them later. None of that fits in an order record, and so far Squarespace hasn’t added it. Merchants have asked on the forum many times:
- Is it possible to let customers upload pictures?
- Adding an upload form option for a product
- Allow customers to upload images in the product form at checkout (commissions and custom orders)
- How to allow customers to upload a high-resolution photo as part of their order information
Getting a file onto the order without a file field
CartDocket keeps Squarespace’s cart and checkout in charge and stores the file somewhere built for files:
- A script in your site’s Footer code injection adds an uploader to the products you pick, just above Add to Cart, or inside the product’s Add to Cart form if it has one.
- The shopper attaches their file. It goes straight to secure storage and gets a short reference code, like
CD-7K2QXM. - When the shopper clicks Add to Cart, the code is kept with that item in their browser. For a required product, Add to Cart waits until the file is there.
- After checkout, the same code in Squarespace’s Order Status Page code injection box runs on the confirmation page and sends the codes with the order number and email.
- CartDocket checks the order number and email with Squarespace, then links each file to its order and line item.
The cart, checkout and order emails stay Squarespace’s own, and each Add to Cart gets its own code, so two of the same product in one cart keep separate files.
If you already use an Add to Cart form
Keep it. On products with a form, the uploader appears inside the form. If you also want the code on the order in Squarespace, add a
Text field to the form named like your CartDocket field label (default CartDocket file, under Default file settings →
Advanced). CartDocket fills it in and hides it, so the order line shows, for example, CartDocket file: CD-7K2QXM.
That’s optional: the file reaches the order either way.
What you’ll see on the order
In the CartDocket dashboard, the order shows the actual files with their size, dimensions and any print check result, plus buttons to download one file or a zip of the whole order. Files can only be downloaded from your signed-in dashboard; a code that turns up in an order email is a reference, not a link.
Setting it up
- Sign in to CartDocket with Squarespace and paste its code into two Code Injection boxes, Footer and Order Status Page (see the install guide).
- In CartDocket, tick the products that take files, and turn on Required where a file is a must.
- Place a test order on your live site with a file attached, and check it shows on the order in your dashboard.
Common mistakes
- Code pasted into only one box. In Footer it shows the uploader; in Order Status Page it attaches the files to the order. Paste it into both.
- Code on one page only. Squarespace can load pages without a full reload (always on 7.1, and on 7.0 templates with Ajax loading), so the code must be in the site-wide Footer box.
- Scripts disabled in the editor preview. If Squarespace says scripts are disabled on your site preview, turn them back on, or test on your live site.
- Basic plan. Code Injection starts at Core. On Basic, use the post-checkout upload page (Maker, Pro and Studio plans) instead.