Skip to main content
The wishlist feature lets customers save products to their account so they can find them later. Saved items sync across devices and persist between sessions.

Add a save button

Use HTML attributes or JavaScript to add a save/unsave toggle to any page.
Wrap your save button in <swish-save> and tell it where to read the product from. context="pdp" resolves from the current URL and watches SPA navigation; context="product-card" walks to the nearest product link in the surrounding card and watches its href. Mark conditional children with data-swish-when - the SDK toggles their visibility based on the parent’s state attribute.
When the rendered DOM doesn’t carry the product reference, pass product and variant attributes explicitly. See the elements reference for the full attribute set.
More patterns, including a custom wishlist page, are on the SDK examples page.

Configuration options

Control how the save and unsave flows behave by passing intent options to the SDK configuration.

Save behavior

Set these under intents.saveProduct in your SDK options:

Unsave behavior

Set these under intents.unsaveProduct:
For the full list of intent options, see the SDK configuration reference.