Answers.Body: <p>You can definitely use Shortlist for this.  Here's some code to get you started.  Note in this I allow the favouriting of both products and pages/articles.</p>
  
  <p>Code to let user add the favourites -</p>
  
  <pre><code>    {% set item = craft.shortlist.item(id) %}
      &lt;span class="favStar"&gt;&lt;a class="shortlist_action reset-a" title="Add To Favourites" href="{{ item.addActionUrl }}"&gt;&lt;i class="favStar__icon icon-"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/span&gt;
  </code></pre>
  
  <p>And to display the favourites/wishlist - first we prepare by separating products from regular elements:</p>
  
  <pre><code>        {# Prepare the output data #}
          {% set lists = craft.shortlist.lists %}
          {% set favouriteArticleIDs = [] %}
          {% set favouriteProductIDs = [] %}
  
          {% if lists|length %}
              {# We just store everything in one list... #}
              {% for list in lists %}
                  {% for item in list.items %}
                      {% set favId = item.elementId %}
                      {% if item.element.elementType == 'Commerce_Product' %}
                          {% set favouriteProductIDs = favouriteProductIDs|merge([favId]) %}                          
                      {% else %}
                          {% set favouriteArticleIDs = favouriteArticleIDs|merge([favId]) %}
                      {% endif %}                
                   {% endfor %}
              {% endfor %}
          {% endif %}
  </code></pre>
  
  <p>...then to actually fetch &amp; display the results we do this:</p>
  
  <pre><code>            {% if not favouriteProductIDs|length %}
  
                  &lt;strong&gt;No favourite products?  Why not add some?&lt;/strong&gt;
  
              {% else %}
  
                  {% set products = craft.commerce.products.id(favouriteProductIDs).order('title').with('variants') %}                    
  
                  {% import "_macros/productPreviewsLib" as productPreviewsLib %}
  
                  {{
                      productPreviewsLib.productPreviews(products,
                      {
                          'display' : 'Table',
                          'showUnavailables' : true,
                      })
                  }}
  
              {% endif %}
  </code></pre>
  
  <p>(The macro just does <code>{% for product in products %}</code> etc)</p>
  
  <p>That should get you started!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-02T23:47:02.357Z
Answers.Text: Jeremy, is Shortlist working on an up to date Craft install? Docs show 1.0.2 as the last version in 2015 which was prior to Craft 2.5. I'm wondering if it's been updated but just not documented on the changelog as I see references to a version 1.1??
Answers.UserDisplayName: shorn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-03T00:52:42.363Z
Answers.Text: I'm using Shortlist 1.0.4 which I believe it the latest release, with the latest Craft and Commerce releases, no issues.
Answers.UserDisplayName: Jeremy Daalder
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-03T08:38:13.857Z
Answers.Text: Cool, thanks! It's currently the only plugin out there that seems like it fits my need, but from the site it looks a little neglected!
Answers.UserDisplayName: shorn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-17T23:07:30.127Z
Answers.LastActivityDate: 2017-01-17T23:07:30.127Z
Answers.UserDisplayName: Jeremy Daalder
Answers.Body: <p>Digging up an old question here but in order to display the title (and other field data) for Commerce products you need to use <code>{{ item.element.title }}</code></p>
  
  <p>Thanks to James Greig for that tip.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-18T14:37:15.630Z
Answers.LastActivityDate: 2018-05-21T07:44:37.617Z
Answers.LastEditDate: 2018-05-21T07:44:37.617Z
Answers.UserDisplayName: foamcow
Body: <p>I'd like to use the <a href="https://squarebit.co.uk/software/craft/shortlist/overview" rel="nofollow noreferrer">Shortlist</a> plugin to allow visitors to create product wishlists - using Craft Commerce.</p>
  
  <p>Currently, I have setup the 'add to wishlist' function, but I am not sure how to then display the items that a user has add to their wishlist.</p>
  
  <p>The code below, is the example given on the plugin docs for how to loop through the items a user has added, but this does not produce the required results for commerce products.  </p>
  
  <pre><code>{% if shortlistLists is empty %}
  You have no lists at the moment.
  {% else %}
      {% for list in lists %}
      &lt;h3&gt;{{ list.title }}&lt;/h3&gt;
  
      {% if list.items is empty %}
      No items in this list
      {% else %}
      &lt;ul&gt;
          {% for item in list.items %}
              &lt;li&gt;{{ item.title }} (&lt;a href="{{ item.removeActionUrl }}"&gt;Remove&lt;/a&gt;)&lt;/li&gt;
          {% endfor %}
      &lt;/ul&gt;
      {% endif %}
      {% endfor %}
  {% endif %}
  </code></pre>
  
  <p>The docs for the plugin are available here - <a href="https://squarebit.co.uk/software/craft/shortlist/usage/quickstart" rel="nofollow noreferrer">https://squarebit.co.uk/software/craft/shortlist/usage/quickstart</a></p>
  
  <p>If anyone could point me in the right direction as to how to successfully use the plugin in conjunction with Craft Commerce, that would be much appreciated.</p>
  
Tags: <plugin-craftcommerce><plugin-shortlist>
Title: Using Shortlist plugin to create product wishlist
ThreadText: # Using Shortlist plugin to create product wishlist
  
  (Asked by: username_0 on 2017-01-16)
  
  I'd like to use the [Shortlist](https://squarebit.co.uk/software/craft/shortlist/overview) plugin to allow visitors to create product wishlists - using Craft Commerce.
  
  Currently, I have setup the 'add to wishlist' function, but I am not sure how to then display the items that a user has add to their wishlist.
  
  The code below, is the example given on the plugin docs for how to loop through the items a user has added, but this does not produce the required results for commerce products.
  
  ```
  {% if shortlistLists is empty %}
  You have no lists at the moment.
  {% else %}
      {% for list in lists %}
      <h3>{{ list.title }}</h3>
  
      {% if list.items is empty %}
      No items in this list
      {% else %}
      <ul>
          {% for item in list.items %}
              <li>{{ item.title }} (<a href="{{ item.removeActionUrl }}">Remove</a>)</li>
          {% endfor %}
      </ul>
      {% endif %}
      {% endfor %}
  {% endif %}
  
  ```
  
  The docs for the plugin are available here - <https://squarebit.co.uk/software/craft/shortlist/usage/quickstart>
  
  If anyone could point me in the right direction as to how to successfully use the plugin in conjunction with Craft Commerce, that would be much appreciated.
  
  **Tags:** plugin-craftcommerce, plugin-shortlist
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-01-17. Score: 2
  
  You can definitely use Shortlist for this. Here's some code to get you started. Note in this I allow the favouriting of both products and pages/articles.
  
  Code to let user add the favourites -
  
  ```
      {% set item = craft.shortlist.item(id) %}
      <span class="favStar"><a class="shortlist_action reset-a" title="Add To Favourites" href="{{ item.addActionUrl }}"><i class="favStar__icon icon-"></i></a></span>
  
  ```
  
  And to display the favourites/wishlist - first we prepare by separating products from regular elements:
  
  ```
          {# Prepare the output data #}
          {% set lists = craft.shortlist.lists %}
          {% set favouriteArticleIDs = [] %}
          {% set favouriteProductIDs = [] %}
  
          {% if lists|length %}
              {# We just store everything in one list... #}
              {% for list in lists %}
                  {% for item in list.items %}
                      {% set favId = item.elementId %}
                      {% if item.element.elementType == 'Commerce_Product' %}
                          {% set favouriteProductIDs = favouriteProductIDs|merge([favId]) %}                          
                      {% else %}
                          {% set favouriteArticleIDs = favouriteArticleIDs|merge([favId]) %}
                      {% endif %}                
                   {% endfor %}
              {% endfor %}
          {% endif %}
  
  ```
  
  ...then to actually fetch & display the results we do this:
  
  ```
              {% if not favouriteProductIDs|length %}
  
                  <strong>No favourite products?  Why not add some?</strong>
  
              {% else %}
  
                  {% set products = craft.commerce.products.id(favouriteProductIDs).order('title').with('variants') %}                    
  
                  {% import "_macros/productPreviewsLib" as productPreviewsLib %}
  
                  {{
                      productPreviewsLib.productPreviews(products,
                      {
                          'display' : 'Table',
                          'showUnavailables' : true,
                      })
                  }}
  
              {% endif %}
  
  ```
  
  (The macro just does `{% for product in products %}` etc)
  
  That should get you started!
  
  > **Comments:**
  > **username_2**: username_1, is Shortlist working on an up to date Craft install? Docs show 1.0.2 as the last version in 2015 which was prior to Craft 2.5. I'm wondering if it's been updated but just not documented on the changelog as I see references to a version 1.1??  
  > **username_1**: I'm using Shortlist 1.0.4 which I believe it the latest release, with the latest Craft and Commerce releases, no issues.  
  > **username_2**: Cool, thanks! It's currently the only plugin out there that seems like it fits my need, but from the site it looks a little neglected!  
  
  ---
  
  ### Answer by username_3 on 2018-05-18. Score: 1
  
  Digging up an old question here but in order to display the title (and other field data) for Commerce products you need to use `{{ item.element.title }}`
  
  Thanks to James Greig for that tip.
  
  
  ---
  
  