Skip to main content

reject

array | reject: string, string

Filters an array to exclude items with a specific property value.

This requires you to provide both the property name and the associated value.

{% assign polina_products = collection.products | reject: 'vendor', "Polina's Potent Potions" %}

Products from other vendors than Polina's Potent Potions:

{% for product in polina_products -%}
- {{ product.title }}
{%- endfor %}

Output

Products from other vendors than Polina's Potent Potions:

- Charcoal
- Dandelion milk
- Dried chamomile
- Forest mushroom
- Glacier ice
- Ground mandrake root
- Komodo dragon scale
- Viper venom
- Whole bloodroot
Was this page helpful?