A seamless, high-converting "Add to Wishlist / Quote Request" experience for your Squarespace website (lofte.co.nz).
This script adds an elegant, heart-button quote collector to the hire catalog pages (plates, cutlery, glassware, holders).
lofte.co.nz does not use Squarespace Commerce. There is no Products collection, no product grid, and no product detail pages. Every hire item is hand-built on an ordinary page using Fluid Engine blocks, laid out like this:
[ image block ] β the product photo
[ html block ] β the product name e.g. "SIGNATURE DINNER PLATE"
[ html block ] β the size / price / GST line
Because there is no wrapper element around each item, the script identifies products geometrically: for each photo inside the page content, it finds the nearest text block sitting directly below it in the same column. That name becomes the item title, and a slug of it becomes the item ID.
This approach:
- works on desktop and mobile, where Fluid Engine reflows every block into its own row;
- survives the grid being rearranged in the Squarespace editor;
- ignores the header and footer, so the footer logo is never picked up as a product.
If you ever migrate to real Squarespace Products, this detection logic will need rewriting to use
.grid-item/.ProductList-itemselectors instead. SeefindProducts()in the script.
The home page and About page are built from the same image-block-then-text-block pattern as the catalog. The home page hero, the four category tiles (PLATES, CUTLERY, GLASSWARE, HOLDERS) and the "HOW IT WORKS" panel are structurally identical to hire items, so the detector cannot tell them apart by shape alone.
Hearts are therefore restricted to an explicit list of catalog pages, set near the top of the script:
CATALOG_PATHS: ['/all-hire', '/plates', '/cutlery', '/glassware', '/holders'],π¨ If you add a new category page (for example
/linens), you must add its path to this list, or its items will not get heart icons.
As a second safeguard, any photo wrapped in a link is skipped, since that pattern means a navigation tile rather than a hire item. If you ever make a hire item's photo clickable, it will stop getting a heart.
An item's ID is a slug of its name (SIGNATURE DINNER PLATE β signature-dinner-plate). The same item on /all-hire and on /plates therefore shares one ID, so hearting it in either place refers to the same entry in the quote list. Two different items must not share a name, or they will be treated as the same item.
- β€οΈ Heart Icons on Products: Visitors can click the heart icon on any hire item photo to save it.
- π± Real-Time Floating Badge: Displays total saved items at the bottom right corner of the screen.
- πͺ Slide-Out Quote Drawer: Click the floating badge to slide open a modern quote drawer showing selected items, thumbnail photos, item links, and quantity adjusters (
-/+). - π Event Details Inquiry Form: Collects the client's name, email, phone number, event date, event location/venue, approximate guest numbers, and custom notes.
- πΎ Automatic Save (Browser Storage): Items stay saved even if the visitor closes their browser or navigates between pages.
- β‘ Zero External Plugins Needed: Works directly inside Squarespace without monthly app subscription fees.
Follow these simple steps to install the system on your Squarespace site in under 5 minutes:
- Log into your Squarespace Site Admin Panel.
- Depending on your Squarespace version:
- Squarespace 7.1 (Most Common): Go to Website β Website Tools β Code Injection.
- Squarespace 7.0: Go to Settings β Advanced β Code Injection.
- Open the
lofte-wishlist-quote.htmlfile included in this repository. - Select and copy all the text inside that file.
- In your Squarespace Code Injection screen, scroll down to the FOOTER text box.
- Paste the copied code into the FOOTER box.
When a customer submits a quote request, the form needs to send their event details and item list to your email or inbox.
By default, the script supports Formspree (a free & easy tool for receiving form submissions via email).
- Go to Formspree.io and create a free account.
- Click "+ New Form", give it a name like "Lofte Quote Requests", and enter the email address where you want to receive quote notifications.
- Formspree will give you a Form Endpoint URL that looks like this:
https://formspree.io/f/mqkvqjze - Copy that URL.
- In your Squarespace FOOTER code box where you pasted the script, find
WEBHOOK_URL:WEBHOOK_URL: 'https://formspree.io/f/mppaplyo',
- The script is configured with your Formspree endpoint (
https://formspree.io/f/mppaplyo). You can update this string anytime if your endpoint changes.
Note for Advanced Users: You can also use a Zapier Webhook, Make.com Webhook, or HubSpot Endpoint URL here if you want quote requests to automatically go into your CRM or Google Sheets!
- Click Save in the top-left corner of Squarespace.
- Open your website in a new browser tab or on your phone.
- Browse your catalog items and click a Heart Icon.
- You will see the Saved Items (1) button appear at the bottom right!
- Click it, test adjusting quantities, fill out a sample quote form, and hit Submit Quote Request.
If you ever want to tweak the design to match your brand colors, you can easily change the styling variables at the very top of the script:
:root {
--lofte-primary: #1a1a1a; /* Main text and button background */
--lofte-accent: #c86d51; /* Terracotta heart color & badges */
--lofte-accent-hover: #b05a40; /* Hover shade for buttons */
--lofte-bg-light: #fafafa; /* Light gray background color */
--lofte-card-bg: #ffffff; /* Drawer white background */
}- Simply replace
#c86d51with your brand's hex code (e.g.#D4A373or#000000).
Yes! All selected items are safely stored in the visitor's web browser (localStorage). When they return to your site, their saved items will automatically reappear.
Yes! The floating badge and slide-out drawer are fully responsive and optimized for iPhone, Android, iPad, and desktop screens.
Yes. In the script, locate the <form id="lofte-quote-form"> section to add, edit, or remove fields (like Event Type, Delivery vs Pick-up, etc.).
To make a field optional, delete required from its <input> and drop the <span class="req">*</span> from its label. For example, Approx Number of Guests is required by default to match the wording on the /all-hire-2 form β remove required from #lofte-f-guests if you would rather not gate the enquiry on it.
When you add a new field, give the <input> a name, then add that name to the payload object in handleFormSubmit() so it reaches your inbox. A field that is not in the payload will not be sent.
No. All styling is scoped to .lofte-* class names, and the script only reads the page β it never modifies your content blocks. The one shared rule it sets is position: relative on image blocks, which Squarespace already applies anyway.
First check: is the page listed in CATALOG_PATHS? A new category page gets no hearts until you add its path. See the warning above.
Then open the site, press F12 to open the browser console, and run:
LofteQuote.products()- Returns a list of your items β detection is working; the problem is styling. Check that the heart is not hidden behind another element.
- Returns an empty list on a catalog page β the page structure is not what the script expects. The most likely cause is that a product's name is not in a text block directly below its photo. Open the page in the Squarespace editor and check the block layout.
- Returns an empty list on the home/About page β this is correct and intentional.
A hero banner or category tile is being matched. Either the page should not be in CATALOG_PATHS, or the decorative image needs to stop looking like a product β wrapping it in a link is enough to exclude it.
Heart size is scaled to each photo's width and then clamped, so a small mobile thumbnail does not get swamped. Tune these in CONFIG:
HEART_SCALE: 0.16, // fraction of the photo's width
HEART_MIN: 26, // never smaller than this (keeps the tap target usable)
HEART_MAX: 38, // never larger than thisOther useful console commands:
| Command | What it does |
|---|---|
LofteQuote.products() |
Lists every item detected on the current page |
LofteQuote.basket() |
Shows the saved quote list |
LofteQuote.clear() |
Empties the quote list |
LofteQuote.rescan() |
Forces a re-scan of the page |
LofteQuote.open() |
Opens the quote drawer |
For verbose logging, set DEBUG: true in the CONFIG block near the top of the script.
This is intentional β the floating button stays hidden until at least one item is saved. Click a heart and it will appear.
The script looks for the price text in a block directly beneath the item's name. If an item's price block is missing or positioned somewhere else in the Fluid Engine grid, the item still works β the quote email just shows the name and quantity without the price line.
The drawer now shows the actual reason inside the form when a send fails, rather than failing silently. Common causes:
- The Formspree form has not been confirmed β check the inbox you registered for a confirmation email from Formspree.
- The monthly free-tier submission limit has been reached.
WEBHOOK_URLdoes not match your current Formspree endpoint.
If you have any questions or need help customizing your quote workflow, feel free to reach out to your web development team Blair and midnightpickle.app ππ₯