Wishlists
ShopWired themes include a built-in wishlist system that works entirely through stored in the visitor’s browser. Each device keeps its own list of saved products, so a wishlist created on a visitor's laptop won’t automatically appear on their phone or tablet, even if they are logged into a customer account. This system requires no configuration, works out of the box with all ShopWired themes, and doesn’t store any wishlist data in the ShopWired platform itself.
Account wishlist
An alternative wishlist system, known as the account wishlist can be implemented manually into themes where wishlist data is stored directly on the ShopWired platform. This allows a customer’s wishlist to stay consistent across all devices as long as they are logged in.
- Unlike the cookie-based version, this approach requires theme changes and makes use of calls to the platform to save, retrieve, and display the customer’s wishlist items
- Each customer account wishlist is available at a URL on your domain name and is available publicly so that customers can share it with their friends/family
- A visitor must be logged into a customer account to add and remove products from their wishlist
Theme support for the account wishlist feature
To add support for the account wishlist feature in your theme, use the features described below.
global.customer.public_wishlist_id
Returns the ID of the visitor’s public wishlist. Every logged-in visitor has a public wishlist ID.
You can build the wishlist URL like this:
/wishlist/{{ global.customer.public_wishlist_id }}
e.g.
https://www.yourdomain.com/wishlist/{{ global.customer.public_wishlist_id }}
product.in_public_wishlist
Returns true if the current product is already in the visitor’s public wishlist.
Adding a product to the wishlist
To add a product, use the action query parameter with the value add, and pass the product ID using product_id.
e.g.
/wishlist/{{ global.customer.public_wishlist_id }}?action=add&product_id={{ product.id }}
Removing a product from the wishlist
To remove a product, use the action query parameter with the value remove, and pass the product ID using product_id.
e.g.
/wishlist/{{ global.customer.public_wishlist_id }}?action=remove&product_id={{ product.id }}