Skip to content
CartDocket

Squarespace Add to Cart form: file upload field

Updated · by the CartDocket team

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:

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:

  1. 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.
  2. The shopper attaches their file. It goes straight to secure storage and gets a short reference code, like CD-7K2QXM.
  3. 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.
  4. 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.
  5. 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

  1. Sign in to CartDocket with Squarespace and paste its code into two Code Injection boxes, Footer and Order Status Page (see the install guide).
  2. In CartDocket, tick the products that take files, and turn on Required where a file is a must.
  3. 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.

Frequently asked questions

Does the Squarespace Add to Cart form have a file upload field?

No. Squarespace product forms offer fields for text and choices, and every answer is saved as text on the order. There is no field type that accepts a file.

Do I need an Add to Cart form to collect files with CartDocket?

No. CartDocket adds its uploader to the product page itself, just above Add to Cart. If a product already has an Add to Cart form, the uploader appears inside that form instead, so you can keep the form you have.

Can I put an upload in a separate form block on the product page instead?

You can, but a separate form isn’t connected to the cart. Its submissions arrive on their own, not on the order, so you have to match them to orders by hand. An uploader tied to the Add to Cart button avoids that.

Can I make the file required?

Yes. Turn on Required for the product in CartDocket, and Add to Cart waits until the shopper has attached a file and it has finished uploading. If a product blocks files that are too small to print and the file fails, the shopper sees why.

Can one product take more than one file?

Yes. You choose how many files each product accepts, up to 10. All of them are attached to the same line of the order.

What if a shopper’s browser blocks the script?

They see the product page without the uploader. Link your post-checkout upload page (Maker, Pro and Studio plans) in the product description so those shoppers can still send their file, attached to their order.

Stop chasing files by email

Connect your store, paste one piece of code and tick the products that take files. Every new store gets Pro free for 14 days, then stays on the Free plan unless you choose to upgrade.