Skip to content

all_products object ​

Looks up a product by its slug: all_products['slug']. The result is a product object, or nil.

A page can look up at most 20 different products this way. Further lookups return nil. To list products, use a collection instead, for example collections['all'].products.

liquid
{% assign product = all_products['linen-shirt'] %}
{% if product %}
  <a href="{{ product.url }}">{{ product.name }}</a>
{% endif %}