Clive Portman: code

Fetch entries with an empty field using Craft CMS or Craft Commerce

This works with a custom field that is a checkbox and fetches only entries where that checkbox is not checked.

{% set products = craft.commerce.products({
 customField: ':empty:',
 hasVariant: {
    hasStock: true
 },
  type: 'class',
 limit: 5
}) %}