Option 1: the snippet
With theloveful-wishlist snippet created, render it in the header file (header.liquid in most themes), next to the cart icon:
sections/header.liquid
<loveful-count> badge, counted in Liquid for the signed-in shopper so it’s right on first paint:
99+ above 99. It takes the header’s text colour, with the number in the opposite colour. Restyle it with:
The snippet’s
aria-label starts as the English “Wishlist”. Once the page loads, Loveful sets it from the loveful.header_label translation, so it’s read aloud in the shopper’s language. Change the wording on Settings › Translations.Option 2: loveful-header-icon
A ready-made heart and badge, with no snippet needed. Wrap it in a link:<loveful-count>, and labels it with the loveful.header_label translation unless it already has an aria-label. Its size and colours are --loveful-icon-size, --loveful-icon-color, --loveful-count-bg and --loveful-count-fg. See <loveful-header-icon>.
Option 3: the theme’s own icon
To match the theme’s other header icons exactly, use its own icon markup and add a<loveful-count>:
sections/header.liquid
app--1234567 with the namespace in your loveful-wishlist snippet. Here the theme’s bubble wraps the count, so hide the bubble too when the count hides:
<loveful-count> sets hidden and data-count on itself; see <loveful-count> for data-cap and data-hide-at-zero.
A count anywhere else
The same element works in a mobile menu, a drawer or the wishlist page’s heading:window.loveful.state.size on the bus’s item_added, item_removed and list_cleared events. See React to saves.