Skip to main content

Sidebar Wishlist Block

Learn how to enable the Wishlist block in the Account Sidebar and add the heart button to your Shopify theme so customers can save and share their favorite products.

Written by Kris James

šŸ”— Before You Start

Wishlist requires customer accounts to be enabled on your Shopify store. By default, customers must be logged in to save and view wishlist items. To let logged-out shoppers save items too, turn on Allow guest wishlists under Wishlist, then Settings.


How to Add the Wishlist Block

  1. From your Shopify admin, open the Mage Loyalty app.

  2. In the left menu, click Account Sidebar.

  3. Make sure Enable Account Sidebar is toggled on at the top of the page.

  4. Click the Pages tab, then Home.

  5. Click Add and select Wishlist.

  6. Toggle the Wishlist block on.

  7. Click the Wishlist block to expand its settings.

  8. Configure the fields (see 'Configure the Wishlist Block' below), then save your changes.

ā„¹ļø Note

Unless guest wishlists are allowed, the Wishlist block is marked "Logged in only". It then only appears to customers who are signed into their account, and logged-out visitors do not see the Wishlist section in the sidebar.


Configure the Wishlist Block

Once the Wishlist block is expanded, you can configure the following settings:

Field / Setting

What It Does

Default

Wishlist Title

The heading displayed above the wishlist in the sidebar. Customers see this when they open the Account Sidebar.

My Wishlist

Empty State Text

The message shown when a customer has not saved any products yet.

No wishlisted items yet

Enable Wishlist Hearts

Shows a heart on the product cards in every sidebar product block, so customers can save a product without leaving the sidebar.

Off

Show Circle Behind Heart

Adds a white circle behind the heart. Shown once Enable Wishlist Hearts is on.

Off

Active colour

The colour of the heart on a product the customer has saved.

Black

Inactive colour

The colour of the heart on a product the customer has not saved.

Dark grey

āœ… Tip

Keep the Wishlist Title short and friendly. "My Wishlist", "Saved Items", or "My Favourites" all work well. Avoid anything too generic like "Products". It should feel personal to the customer.

āœ… Tip

Customers can share a wishlist collection as a link, and there is nothing to turn on. Customers sharing wishlists before birthdays, holidays, or gift-giving occasions can drive new visitors to your store with warm purchase intent.


Reorder the Wishlist Block

You can control where the Wishlist block appears within the Account Sidebar by dragging it to a new position.

  1. Under Pages, then Home, in the Account Sidebar, look for the drag handle ( ā æ ) on the left side of the Wishlist row.

  2. Click and drag the block to your preferred position in the list.

  3. Save your changes.

ā„¹ļø Note

Some blocks are marked as Required and cannot be moved or disabled. The Wishlist block is not required — it can be freely repositioned or turned off at any time.


Add the Heart Button to Your Theme

The heart button is the icon customers click on product pages and collection pages to save a product to their wishlist. Without this step, customers have no way to add products, and the Wishlist block in the sidebar will remain empty.

This step requires editing your Shopify theme templates. If you are not comfortable editing theme code, pass this section to your developer or contact the Mage Loyalty team for assistance.

Basic Snippet

Copy the snippet below and add it to your theme wherever you want the heart icon to appear:

<mage-wishlist-heart product-id="{{ product.id }}"></mage-wishlist-heart>

This renders a heart icon that toggles between outline (not saved) and filled (saved). A toast notification confirms the action.

Adding a text label

To show a text label alongside the heart icon (e.g. "Add to Wishlist"), add the data-show-text attribute:

<mage-wishlist-heart
product-id="{{ product.id }}"
data-show-text="true">
</mage-wishlist-heart>

The text automatically switches between "Add to Wishlist" and "In Wishlist" when toggled. You can customise the text with data-add-text and data-added-text:

<mage-wishlist-heart
product-id="{{ product.id }}"
data-show-text="true"
data-add-text="Save for Later"
data-added-text="Saved!">
</mage-wishlist-heart>

Available Attributes

Attribute

Required

Default

Description

product-id

Yes

—

The Shopify product ID. Use {{ product.id }} in Liquid.

data-show-text

No

false

Set to "true" to show a text label next to the heart icon.

data-add-text

No

"Add to Wishlist"

Custom text shown when the product is not wishlisted.

data-added-text

No

"In Wishlist"

Custom text shown when the product is wishlisted.

data-trigger-toast

No

true

Set to "false" to disable the toast notification on this button.


Where to Place the Snippet

You can add the snippet to any template that has access to the product object. Common placements are:

  • Product page template: appears on individual product pages

  • Product card template: appears on collection pages and search results

  • Featured product sections: appears on the homepage or landing pages

  • Anywhere else in your theme that renders a product object

How to Add the Snippet

  1. In your Shopify admin, go to Online Store > Themes.

  2. Click Customise on your active theme, or click the three-dot menu ( ā‹® ) and select Edit code.

  3. Open the template file where you want the heart to appear (e.g. product-card.liquid or main-product.liquid).

  4. Paste the snippet in the position where you want the heart icon to render, typically near the product image or the Add to Cart button.

  5. Save the file.

  6. Visit a product page or collection page on your storefront to confirm the heart icon is rendering correctly.


Customising the Appearance

The heart button ships with minimal default styles so it inherits your theme's look. To customise, add CSS to your theme stylesheet. Examples:

CSS Class

Description

.mage-wishlist-heart__btn

The heart button container

.mage-wishlist-heart__btn--active

Applied when product is wishlisted

.mage-wishlist-heart__btn--with-text

Applied when text label is enabled (icon + text layout)

.mage-wishlist-heart__text

The text label span ("Add to Wishlist" / "Added!")

.mage-wishlist-toast

The toast notification container

.mage-wishlist-toast--visible

Applied when toast is showing

/* Change heart color */
.mage-wishlist-heart__btn svg {
stroke: red;
}
.mage-wishlist-heart__btn--active svg {
stroke: red;
fill: red;
}

/* Style the text label */
.mage-wishlist-heart__text {
color: #333;
font-size: 12px;
}

/* Adjust icon + text spacing */
.mage-wishlist-heart__btn--with-text {
gap: 8px;
}

/* Style the toast notification */
.mage-wishlist-toast {
background: #333;
color: #fff;
border-radius: 8px;
}

āš ļø Common Mistake

Do not place the snippet in templates that do not have access to the product object. For example, a blog post template or the cart page. The snippet requires {{ product.id }} to be available or the heart button will not render.


What the Customer Experience Looks Like

  • Customer logs into their account on your storefront.

  • On any product page or collection page, they see a heart icon ( ā™” ) next to the product.

  • Clicking the heart saves the product to their wishlist.

  • They open the Account Sidebar and navigate to the Wishlist section to see all their saved items.

  • They can copy a shareable link to send a wishlist collection to friends or family.

  • Clicking a saved product takes them directly to the product page to purchase.

ā„¹ļø Note

Unless guest wishlists are allowed, the Wishlist block is only visible to logged-in customers. Customers who are not signed in will not see the block in the sidebar.


Common Mistakes to Avoid

āš ļø Common Mistake

Enabling the Wishlist block but forgetting to add the heart button snippet: The block will appear in the sidebar, but customers will have no way to add products to it. Both steps are required.

āš ļø Common Mistake

Placing the snippet in a template without access to product.id: The heart icon will not render. Always check that the template you are editing has the product object available before adding the snippet.

āš ļø Common Mistake

Expecting guests to use the Wishlist without turning it on: guest wishlists are off by default. Turn on Allow guest wishlists under Wishlist, then Settings, if you want logged-out shoppers to save items.

āš ļø Common Mistake

Leaving the Wishlist block enabled without the Account Sidebar enabled — The Wishlist block lives inside the Account Sidebar. If the sidebar itself is toggled off, the Wishlist will not be visible to customers regardless of its own toggle state.


Troubleshooting

The heart button is not appearing on product pages

  • Check that the snippet has been added to the correct template file in your theme.

  • Confirm the template has access to {{ product.id }}- if product.id is undefined, the button will not render.

  • Clear your browser cache and refresh the page.

  • If you are using a custom or heavily modified theme, reach out to the Mage Loyalty team through our live chat support for direct assistance for theme-specific guidance.

The Wishlist block is not showing in the Account Sidebar

  • Confirm the Wishlist toggle is on under Pages, then Home, in the Account Sidebar.

  • Confirm the Enable Account Sidebar toggle at the top of the Account Sidebar page is also on.

  • Confirm the customer is logged in. Unless guest wishlists are allowed, the Wishlist block is only visible to logged-in customers.

A customer saved products but their wishlist appears empty

  • Confirm the customer is logged into the same account they used when they saved the products.

  • Check that the Wishlist block is still enabled in the Account Sidebar settings.

  • If the issue persists, reach out via the Mage Loyalty support chat for investigation.


Related Articles


šŸ—Øļø Still need help or can’t find the answers you’re looking for? Reach out to the Mage Loyalty team through our live chat support.

Did this answer your question?