Skip to main content
Loveful’s blocks cover a standard theme without code. When a theme needs more, everything the blocks use is open to you: put a save button anywhere, build your own wishlist page, react to saves in your own scripts, restyle every element, and receive wishlist events on your own server.

Web components

Seven custom elements: save button, counts, wishlist, share controls and shared list.

JavaScript API

The window.loveful bus: saved state, events, clearing and sharing.

CSS variables

Every --loveful-* custom property, with its default.

Webhooks

Signed wishlist events posted to your own URLs.

How the pieces fit

  • The app embed is required. It’s the only thing that loads Loveful on the storefront. Blocks, the snippet and your own markup all do nothing while it’s off.
  • Nothing is fetched on page load. A signed-in shopper’s saved items come from their customer metafields, printed by the embed. A guest’s are kept in their browser and move to their account when they sign in.
  • Every element follows one state. A save anywhere updates every button, count and list on the page, and in the shopper’s other tabs.
  • Liquid can read the same data. The signed-in customer’s saved variants (refs_1) and each product’s and variant’s saved count (saved_count) are readable under the app’s metafield namespace, app--<id>. Copy it from your loveful-wishlist snippet (Settings > Storefront fills it in).

Quick start

1

Turn on the app embed

In the theme editor, open App embeds and switch on Loveful. Check with window.loveful in the browser console on any storefront page.
2

Create the loveful-wishlist snippet

In Loveful, go to Settings > Storefront and copy the snippet under Product cards and header. In the theme’s Edit code, add a snippet named loveful-wishlist, paste and save. It holds your store’s metafield namespace, and renders card hearts and a header link.
3

Drop in an element

Put a save button anywhere on a product template:
4

Listen for saves

For a script that may run before Loveful’s, see Waiting for the bus.

Guides

Hearts on your product cards

The snippet’s heart, or your own markup.

Header wishlist link

A link with a live count of saved items.

React to saves

Toasts, theme badges and analytics from wishlist events.

Restyle with CSS variables

Match Loveful’s elements to your theme.
Ready-made snippets are on Examples.

What you can’t do from the theme

  • Save or remove from script. The bus has no add or remove method: saves go through a <loveful-button> the shopper clicks, and removes through it or a wishlist card’s remove control. clear() empties a whole list.
  • Render Loveful’s own snippets. loveful-card and loveful-icon belong to the app’s blocks, and Shopify doesn’t let a theme render them. Write your own card markup for <loveful-list>.
  • Read other shoppers’ lists. Only the signed-in shopper’s own list, and lists shared by link, are available on the storefront. For everything else, use webhooks.