You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@dlerm
Hi,
Thanks for the great application. The wishlist works excellently on the Warehouse vintage theme (Not Shopify 2.0), Symmetry Shopify 2.0 theme, and my own unpublished theme.
I would like to show a message that no item is added to the wishlist such as "You have no wishlist item".
const emptyStatement = document.getElementById('oasis-wishlist');
if (emptyStatement.childNodes.length === 0) {
console.log('[Shopify Wishlist] ✅ You have no wishlist item');
};
but they don't work.
Please let me know how to show No result message.
I had to change a couple of things to let the wishlist work.
Had to remove fill="red" in the heart.svg file to let the heart button work.
Needed to change the productCard from productCard: '.product-card' to productCard: '.card' in wishlist.js (You may add a note in your README.md).
The image is not included in the product-card for many Shopify themes. To display the wishlist with images, I added a div with a class (wishlist-image-wrap) and added the code in theme.liquid file.
I think the only thing you need to fix is remove fill="red" in the heart.svg file.
It works great with an easy-to-modify style (look & feel) for any Shopify theme.
Thank you for the awesome work!
The text was updated successfully, but these errors were encountered:
@peoplevillage I think the easiest way to show an "empty" wishlist message would be by editing the setupGrid function inside of Wishlist.js, like this:
const setupGrid = async (grid) => {
const wishlist = getWishlist();
if (!wishlist.length) {
// Wishlist is empty, show message
grid.innerHTML = 'You have no wishlist items.';
} else {
// Show wishlist items
const requests = wishlist.map(fetchProductCardHTML);
const responses = await Promise.all(requests);
const wishlistProductCards = responses.join('');
grid.innerHTML = wishlistProductCards;
}
grid.classList.add(GRID_LOADED_CLASS);
initButtons();
const event = new CustomEvent('shopify-wishlist:init-product-grid', {
detail: { wishlist: wishlist }
});
document.dispatchEvent(event);
};
@dlerm
Hi,
Thanks for the great application. The wishlist works excellently on the Warehouse vintage theme (Not Shopify 2.0), Symmetry Shopify 2.0 theme, and my own unpublished theme.
I would like to show a message that no item is added to the wishlist such as "You have no wishlist item".
I tried
and
but they don't work.
Please let me know how to show No result message.
I had to change a couple of things to let the wishlist work.
and added the wishlist-image-wrap div inside the card class.
I think the only thing you need to fix is remove fill="red" in the heart.svg file.
It works great with an easy-to-modify style (look & feel) for any Shopify theme.
Thank you for the awesome work!
The text was updated successfully, but these errors were encountered: