> For the complete documentation index, see [llms.txt](https://the-wishlist-documentation.gitbook.io/the-wishlist-documentation-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://the-wishlist-documentation.gitbook.io/the-wishlist-documentation-docs/developer-reference/save-for-later.md).

# Shopify Save for Later

To add a 'save for later' or 'move to wishlist' button in your shopify cart, you can apply the same snippet used in the Collection/PLP template, with slight modification.

NOTE: You will need to change the ***{{ card\_product.id }}*** with the actual cart line item like: ***{{ item.id }}***

This snippet should be added in your cart line item 'for' loop:<br>

```
<div class="osc-css wrapper-button-collection">
                      <div class= "button-collection-wishlist button-{{ card_product.id }}" 
                        data-product-id='{{ card_product.id }}' 
                        data-has-only-variant='{{ card_product.has_only_default_variant }}'
                        data-product-title='{{ card_product.title }}'
                      >
                          <span class="button-icon"></span>
                          <span class="button-text"></span>
                      </div>
             </div>
              {% unless product == empty %}
              <script type="application/json" id="ProductJson-{{ card_product.id }}">
                {{ card_product | json }}
              </script>
              <script type="application/json" id="OptionJson-{{ card_product.id }}">
                {{ card_product.options_with_values | json }}
              </script>
            {% endunless %}

```

***If you are using a cart drawer or mini-cart***, you may need to re-dispatch the wishlist event in your cart.js, inside your cart update handler, since cart line items can update dynamically.

Below is a sample snippet for re-dispatching the event.

```
          document.body.dispatchEvent(new CustomEvent('initTheWishlist', {
            detail: { source: 'cart-drawer' }
          }));
```
