How it works
- A customer removes an item from their cart.
- Swish saves the item to their list with
source: "cart". - A feedback toast confirms the save and offers an Undo action that removes the item again if pressed (optional).
confirm is set, Swish asks before saving so the customer can choose whether to keep the item. Set it to "toast" (or true) to ask in a toast, or to "dialog" to ask in a modal dialog the customer can’t miss. In the customiser this is Global → Preferences → Cart → Ask before saving a cart line. The undo action is only shown when confirm is off, since prompting and offering undo would be redundant.
In the drawer, each “Saved from cart” card has a heart that moves the item to the customer’s wishlist with its quantity, taking it out of “Saved from cart”, and a trash button that removes the item from “Saved from cart” after a confirmation. The wishlist item the heart saves carries the saved-from-cart tag. To remove one in code, call swish.api.smartLists.removeItem("saved-from-cart", itemId).
Enabling and disabling
Save from cart is enabled by default. Two settings control the feature:intents.removeCartLine.saveCartLine— triggers the save when a cart line is removed. Enabled by default.- The
saved-from-cartsection in the home view shows the “Saved from cart” smart list in the drawer. Included by default.
Configuration
Fine-tune the save behavior underintents.saveCartLine:
Saving to the wishlist instead
Setdestination to "wishlist" for a “move to wishlist” behaviour: removed cart lines are saved as ordinary wishlist items rather than into the “Saved from cart” smart list. Each one carries the saved-from-cart tag. The saved-from-cart section in the home view then has nothing to show, and the “For you” lists-section in the saves view is hidden along with it. That section renders smart lists only, so hiding it also removes “Recently viewed” — there is currently no way to keep one without the other. Switching the destination in the customiser applies both changes for you; configuring destination in code does not, so hide the sections yourself.
Further reading
- Intents for all cart-related intent options
- Configuration reference for the complete options list