We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

How to retrieve products not owned by customer?

How to retrieve products not owned by customer?

Octipus
Shopify Partner
30 2 7

Hi, 

 

I'm looking for a solution for getting a list of products that the user does not own. 

I know i can iterate through products in a collection with :

 

{% for product in collections.all.products %}
{ endfor %}

 

I also know i can iterate through a a list of items that the user owns with:

 {% for order in customer.orders %}
  {% assign line_item = order.line.items %}
  {% for line_item in order.line_items %}
  {% endfor %}
{% endfor %}

 

 

But how do I iterate through a list of items that contain all products excluding the ones that are own by the customer?

 

Any help would be highly appreciated!

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
Replies 0 (0)