loveful-wishlist snippet, which you create once in the theme’s code.
1. Create the snippet
Loveful can’t write theme files, so the snippet is pasted by hand:- In Loveful, go to Settings > Storefront and click Copy snippet under Product cards and header.
- In the theme’s Edit code, add a snippet named
loveful-wishlist, paste and save.
2. Render it in the card
Find the theme’s product card snippet (card-product.liquid in Dawn and most Shopify themes) and render the heart inside the element that wraps the card’s image:
snippets/card-product.liquid
The card’s product: whatever variable the card snippet uses for it (
card_product in Dawn).The heart is positioned absolutely over the image’s top right corner, so the element that contains it needs
position: relative. Most themes already set it on the card’s media wrapper for their own badges.What it renders
<loveful-button> in card heart mode:
- It saves the product’s selected or first available variant.
- It shows as saved when any variant of the product is saved, and a click on a saved heart removes every saved variant of the product.
- Its click doesn’t open the card’s link.
aria-pressedanddata-savedare worked out in Liquid from the signed-in customer’s saved items, so the heart is right on first paint. A guest’s hearts fill in once the script runs.- The heart is drawn in CSS, not in the markup, so its look can change without re-pasting the snippet.
Position, size and colour
The merchant sets these in the theme editor under App embeds > Loveful > Product card heart (see Save button): position (top right, top left or in line), size, colour, colour when saved, and the white circle behind it. In CSS, set the card heart variables:Writing the markup yourself
Write the element directly when the snippet’s markup doesn’t suit the card, for example to save a particular variant or to put the heart beside the title instead of over the image:<loveful-button>.
Snippet versions
Every element the snippet renders carriesdata-loveful-snippet="<version>"; the current version is 1. Settings > Storefront shows Update needed when the theme’s copy is older: copy the snippet again and paste it over the old one. The render lines in the theme don’t change.