In Shopify there are multiple ways to support add to favorites. Due to this fact, there is not a unified way to support add to favorites in Tweakwise.
If your shop has a wishlist app that has a REST API or JS SDK, this can be supported in Tweakwise JS through events.
To succesfully support add to favorites, follow these steps:
- Add a wishlist button in Plugin Studio.
- Use the event hooks to add the product to your Shopify wishlist app:
window['twn-starter-config'].on = {
// ...,
'twn.add-to-favorites': function (event) {
var productId = event.data.itemno;
// actually call your wishlist app's sdk using productId
}
};