Add a wishlist button to the header menu
Make sure you enable the app in your theme customize.
- Go to
Edit code
in the theme editor - Search for
sections/header.liquid
- Add the following code to where you want it to appear
<xb-wishlist-header class='xb-wishlist__header'>
<a href='#' class='xo-header__right-item xo-header__right-item--heart'>
{% render 'icon', name: 'heart', icon_size: '24', color: 'rgb(var(--color-foreground))' %}
<span class='xb-product-quantity'></span>
</a>
</xb-wishlist-header>
- If you don't want to display the wishlist count, you can remove the following line:
This will hide the numerical indicator for the number of items in the wishlist.
<span class='xb-product-quantity'></span>
- If you want to customize the icon, you can modify this line to use your preferred icon:
{% render 'icon', name: 'heart', icon_size: '24', color: 'rgb(var(--color-foreground))' %}
- Customize the appearance by styling based on our provided classes:
.xb-wishlist__header {
/* Your custom styles for the header container */
}
.xo-header__right-item {
/* Your custom styles for the wishlist button */
}
.xb-product-quantity {
/* Your custom styles for the quantity indicator */
} - Save and publish the changes