How to Use the "Move to Wishlist from Cart Button" Snippet
Add a Move to wishlist button to each item in the cart. When a customer clicks it, the product is saved to their wishlist and removed from the cart. It works on the cart page and in the cart drawer.
Before you start
- Install the R+ Wishlist app.
-
In the theme editor, turn on App embeds → Wishlist helper.
Without the helper, the button can look fine, but clicks will not work.
1. Create the snippet
- Shopify admin → Online Store → Themes.
- On your live theme: ⋯ → Edit code.
- Snippets → Add a new snippet.
- Name it
wl-move-to-wishlist. - Paste the snippet code from this article → Save.
2. Place it in your theme
Open the file that renders the cart items, find the loop over cart items, and add the render tag inside the loop.
Common places:
- Cart page: e.g.
sections/main-cart-items.liquid - Cart drawer: e.g.
snippets/cart-drawer.liquid
Look for a line like this:
{% for item in cart.items %}
Then add the button inside the loop, for example near the item’s Remove button or under the product title:
{% render 'wl-move-to-wishlist', item: item %}
Always pass the cart item. Use the same variable your loop already uses (item , line_item , etc.):
{% render 'wl-move-to-wishlist', item: line_item %}
Tip: If you use both the cart page and the cart drawer, add the snippet to both files.
How the cart updates
By default, the button uses your theme’s own Remove button for the same item. The cart updates exactly as it does when a customer removes an item: no page reload, and totals, the cart icon count and the drawer refresh as usual.
If your theme’s Remove button can’t be found, the page reloads after the move so the cart always shows the correct state.
3. Common examples
Text link (like a regular “Remove” link)
{% render 'wl-move-to-wishlist', item: item, view: 'text_only', text_underline: true, text_size: 13 %}
Icon only
{% render 'wl-move-to-wishlist', item: item, view: 'icon_only', icon_size: 20 %}
Icon + text, outlined button
{% render 'wl-move-to-wishlist',item: item, view: 'icon_and_text', button_border: true, button_border_radius: 4, button_padding_x: 12, button_padding_y: 8 %}
Full-width button with a background
{% render 'wl-move-to-wishlist', item: item, full_width: true, content_align: 'center', button_bg_color: '#f4f4f4', button_padding_y: 10 %}
Icon after the text
{% render 'wl-move-to-wishlist', item: item, icon_position: 'end' %}
Custom label
{% render 'wl-move-to-wishlist', item: item, label: 'Save for later' %}
Logged-in customers only
{% render 'wl-move-to-wishlist', item: item, visibility: 'logged_in_only' %}
No confirmation toast
{% render 'wl-move-to-wishlist', item: item, show_popup: false %}
The toast’s look and position are controlled in Wishlist helper (theme editor), not in the snippet.
4. Parameters
All parameters are optional except item .
| Parameter | Default | Description |
|---|---|---|
item |
(required) | The cart item the button belongs to. Use your cart loop’s variable, e.g. item: item . |
visibility |
everyone |
Who can see the button. Use logged_in_only to show it only to signed-in customers (it stays visible in the theme editor). |
view |
icon_and_text |
What the button shows. Options: icon_and_text , icon_only , text_only . |
icon_position |
start |
Icon before (start ) or after (end ) the text. |
content_align |
left |
Horizontal alignment. Options: left , center , right . |
label |
from translations | Custom button text. Overrides the translation. |
loading_label |
from translations | Text shown while the item is being moved. |
show_popup |
true |
Whether to show the “Added to wishlist” toast. |
icon_color |
current text color | Color of the heart icon. |
icon_size |
18 |
Icon size on desktop, in pixels. |
icon_size_mobile |
18 |
Icon size on mobile, in pixels. |
text_color |
current text color | Color of the label text. |
text_size |
14 |
Label size on desktop, in pixels. |
text_size_mobile |
14 |
Label size on mobile, in pixels. |
text_weight |
inherited | Font weight, e.g. 400 , 600 . |
text_underline |
false |
Underline the label. |
text_transform |
none |
Options: none , uppercase , lowercase , capitalize . |
icon_text_gap |
6 |
Space between the icon and the text, in pixels. |
hover_opacity |
0.7 |
Button opacity on hover, from 0 to 1. |
margin_top / margin_right / margin_bottom / margin_left |
0 |
Outer spacing around the button, in pixels. |
max_width |
0 (no limit) |
Max width of the button, in pixels. |
full_width |
false |
Make the button fill the full available width. |
button_bg_color |
transparent | Button background color. |
button_border |
false |
Show a border around the button. |
button_border_color |
#000000 |
Border color. |
button_border_width |
1 |
Border thickness, in pixels. |
button_border_radius |
0 |
Rounded corners, in pixels. |
button_padding_x |
0 |
Left/right padding inside the button, in pixels. |
button_padding_y |
0 |
Top/bottom padding inside the button, in pixels. |
Advanced (cart update)
You only need these if the cart doesn’t update correctly after a move (see Troubleshooting).
| Parameter | Default | Description |
|---|---|---|
after_move |
auto |
How the cart updates after a move. auto uses your theme’s Remove button, and reloads the page if that button isn’t found. sections refreshes the sections listed in refresh_sections . reload always reloads the page. event doesn’t update the page; your developer handles it. |
remove_selector |
common themes | CSS selector of your theme’s Remove button, if your theme uses a custom one, e.g. '.js-remove-item' . |
refresh_sections |
(none) | Comma-separated section IDs to refresh when after_move is sections . |
5. Button labels (translations)
The snippet uses these translation keys:
wishlist.move_to_wishlistwishlist.moving
If a key is missing, English fallbacks are used (“Move to wishlist” / “Moving…”).
Optional: add them in locales/en.default.json (and your other languages):
"wishlist": { "move_to_wishlist": "Move to wishlist", "moving": "Moving…" }
If "wishlist" already exists, add only these two keys inside it.
Troubleshooting
| Problem | What to check |
|---|---|
| Button does nothing | The Wishlist helper app embed is enabled. |
| Button doesn’t appear | The snippet is inside the cart items loop, and item is passed. |
| Page reloads after a move | Your theme’s Remove button wasn’t found. Pass it with remove_selector , or contact us. |
| Item added to wishlist, but the cart doesn’t update | Try after_move: 'reload' , or contact us. |
| Item stays in the cart | The wishlist couldn’t save the product, so the cart was left unchanged on purpose. Reload the page and try again. If it keeps happening, contact us. |
| A list picker opens | Multiple wishlists is on in Wishlist helper and the customer has more than one list. This is expected. |
Do you need help?
If you have any questions or run into issues, please contact us — we’re happy to help.