Preloader

      Backend filters reference for Shopware 6

      Backend Filters Reference for Shopware 6

      Introduction to Backend Filters in Shopware 6


      If you are building a high-performance eCommerce store on Shopware 6, mastering the Shopware 6 backend filters is absolutely non-negotiable.

      This comprehensive backend filters reference for Shopware 6 walks you through every available filter type, complete with PHP Criteria examples and API Criteria examples, so your development team or your chosen Shopware Development Agency can implement them with precision.

      At iCreative Technologies, a leading Shopware development agency in Germany, we offer top-rated Shopware services and development solutions, including Shopware UI/UX development, custom Shopware development, Shopware plugin development, Shopware theme and template development for UI/UX and optimization, Shopware consulting, and seamless Shopware integration and migration services across Germany.

      What Are Backend Filters in Shopware 6?


      Backend filters in Shopware 6 are programmatic conditions applied to the Criteria object when querying the Data Abstraction Layer (DAL). They allow you to narrow down results by specifying exact values, ranges, partial matches, logical combinations, and negations, all translating into precise SQL statements under the hood.

      Shopware 6 offers the following core filter types:

      • Equals — Exact field match
      • EqualsAny — Match against a list of values
      • Contains — Wildcard search (before and after)
      • Range — Numeric or date-based range filtering
      • Not — Negate any filter condition
      • Multi — Combine multiple filters with logical operators
      • Prefix — Wildcard search at the start of a value
      • Suffix — Wildcard search at the end of a value

      Each of these Shopware filters can be used via the PHP Criteria API (for plugin and backend development) or the Store API / Admin API (for headless and frontend integrations).

      1. Equals Filter — Exact Match Filtering in Shopware 6


      The Equals filter is the most straightforward Shopware 6 filter. It performs an exact match on a given field, equivalent to a SQL WHERE field = value statement.

      PHP Criteria Example

      				
      					$criteria = new Criteria();
      $criteria->addFilter(new EqualsFilter('stock', 10));
      				
      			

      API Criteria Example

      				
      					{
          "filter": [
              {
                  "type": "equals",
                  "field": "stock",
                  "value": 10
              }
          ]
      }
      				
      			

      When to Use the Equals Filter


      Use this filter whenever you need to retrieve records that precisely match a single known value for example, fetching all products with a specific manufacturer ID, a particular active status, or a defined category assignment. Our Shopware 6 developers at iCreative Technologies use this filter heavily in custom Shopware plugin development and Shopware Development Services where precision data retrieval is essential.

      2. EqualsAny Filter — Filter Against Multiple Values

       

      The EqualsAny filter is the Shopware equivalent of SQL’s IN clause. It allows you to match a field against a list of possible values, returning records where at least one value matches exactly.

      SQL equivalent: WHERE productNumber IN ('3fed029475fa4d4585f3a119886e0eb1', '77d26d011d914c3aa2c197c81241a45b')

      PHP Criteria Example

      				
      					$criteria = new Criteria();
      $criteria->addFilter(
          new EqualsAnyFilter('productNumber', [
              '3fed029475fa4d4585f3a119886e0eb1',
              '77d26d011d914c3aa2c197c81241a45b'
          ])
      );
      				
      			

      API Criteria Example

      				
      					{
          "filter": [
              {
                  "type": "equalsAny",
                  "field": "productNumber",
                  "value": [
                      "3fed029475fa4d4585f3a119886e0eb1",
                      "77d26d011d914c3aa2c197c81241a45b"
                  ]
              }
          ]
      }
      				
      			

      When to Use the Shopware EqualsAny Filter


      This Shopware filter is ideal when you have a predefined set of IDs or values, for example bulk product lookups, category-level filtering, or order management workflows where you need to query multiple records by their identifiers in a single efficient call.

      3. Contains Filter — Approximate Value Search in Shopware 6


      The Contains filter performs a full wildcard search, adding a % before and after your search term. This makes it ideal for partial name searches, tag matching, or description-based filtering.

      SQL equivalent: WHERE name LIKE '%Lightweight%'

      PHP Criteria Example

      				
      					$criteria = new Criteria();
      $criteria->addFilter(new ContainsFilter('name', 'Lightweight'));
      				
      			

      API Criteria Example

      				
      					{
          "filter": [
              {
                  "type": "contains",
                  "field": "name",
                  "value": "Lightweight"
              }
          ]
      }
      				
      			

      4. Range Filter — Numeric and Date-Based Filtering


      The Range filter is one of the most powerful Shopware 6 filters for eCommerce use cases. It allows filtering on numeric values (like stock levels or prices) and date fields (like creation dates or scheduled publication times).

      The Range filter supports four operators:

      OperatorMeaning
      gteGreater than or equal to
      lteLess than or equal to
      gtGreater than
      ltLess than


      SQL equivalent:
      WHERE stock >= 20 AND stock <= 30

      PHP Criteria Example

      				
      					$criteria = new Criteria();
      $criteria->addFilter(
          new RangeFilter('stock', [
              RangeFilter::GTE => 20,
              RangeFilter::LTE => 30
          ])
      );
      				
      			

      API Criteria Example

      				
      					{
          "filter": [
              {
                  "type": "range",
                  "field": "stock",
                  "parameters": {
                      "gte": 20,
                      "lte": 30
                  }
              }
          ]
      }
      				
      			

      When to Use the Range Filter


      This filter is essential for price range sliders, inventory management dashboards, date-filtered reporting, and any Shopware Development scenario where users define a minimum and maximum boundary. Combined with Shopware aggregations, the Range filter powers the price filters you see on virtually every professional Shopware storefront built by a quality Shopware 6 Agency.

      5. Not Filter — Negating Conditions in Shopware 6


      The Not filter is a container filter that wraps other filters and negates them. It supports both AND and OR logical operators, giving you fine-grained control over exclusion logic.

      SQL equivalent: WHERE !(stock = 1 OR availableStock = 1) AND active = 1

      PHP Criteria Example

      				
      					$criteria = new Criteria();
      $criteria->addFilter(new EqualsFilter('active', true));
      $criteria->addFilter(
          new NotFilter(
              NotFilter::CONNECTION_OR,
              [
                  new EqualsFilter('stock', 1),
                  new EqualsFilter('availableStock', 10)
              ]
          )
      );
      				
      			

      API Criteria Example

      				
      					{
          "filter": [
              {
                  "type": "not",
                  "operator": "or",
                  "queries": [
                      {
                          "type": "equals",
                          "field": "stock",
                          "value": 1
                      },
                      {
                          "type": "equals",
                          "field": "availableStock",
                          "value": 1
                      }
                  ]
              },
              {
                  "type": "equals",
                  "field": "active",
                  "value": true
              }
          ]
      }
      				
      			

      When to Use the Not Filter


      The Not filter is indispensable for exclusion-based queries  hiding out-of-stock products, excluding inactive categories, removing specific tags from listings, or building “exclude already-seen” recommendation logic. It’s a hallmark of advanced Shopware Development and a filter our Shopware 6 Specialist at iCreative Technologies rely on when building complex catalog rules.

      6. Multi Filter — Combining Filters with Logical Operators


      The Multi filter is the go-to container when you need to combine multiple Shopware filters under a single AND or OR logical condition. Think of it as grouping filter conditions inside parentheses in SQL.

      SQL equivalent: WHERE (stock = 1 OR availableStock = 1) AND active = 1

       

      PHP Criteria Example

      				
      					$criteria = new Criteria();
      $criteria->addFilter(
          new MultiFilter(
              MultiFilter::CONNECTION_OR,
              [
                  new EqualsFilter('stock', 1),
                  new EqualsFilter('availableStock', 10)
              ]
          )
      );
      $criteria->addFilter(new EqualsFilter('active', true));
      				
      			

      API Criteria Example

      				
      					{
          "filter": [
              {
                  "type": "multi",
                  "operator": "or",
                  "queries": [
                      {
                          "type": "equals",
                          "field": "stock",
                          "value": 1
                      },
                      {
                          "type": "equals",
                          "field": "availableStock",
                          "value": 1
                      }
                  ]
              },
              {
                  "type": "equals",
                  "field": "active",
                  "value": true
              }
          ]
      }
      				
      			

      Ready to Scale with Shopware 6?

      Get a future-ready Shopware store designed for speed, flexibility, and results.

      Filter 7: Prefix — Faster Starts-With Search

      The scenario: A customer starts typing “Light” in a search box and you want to return products whose name starts with that string. Or you want all SKUs beginning with “SW-2024-“. You know the match will always be at the beginning of the field.

      This is where Prefix beats Contains on performance. Because the wildcard is only at the endLIKE 'value%' — the database can actually use an index on that field. It’s significantly faster than the double-wildcard Contains on large catalogs.

      SQL under the hood: WHERE name LIKE 'Lightweight%'

      PHP Criteria

      				
      					$criteria = new Criteria();
      $criteria->addFilter(new PrefixFilter('name', 'Lightweight'));
      				
      			

      API Criteria

      				
      					{
          "filter": [
              {
                  "type": "prefix",
                  "field": "name",
                  "value": "Lightweight"
              }
          ]
      }
      				
      			

      When to Choose Prefix Over Contains


      Use the Prefix filter when your search term appears at the beginning of the field value, such as in autocomplete suggestions, SKU lookups, category path matching, or Shopware SEO URL slug searches.

      For autocomplete, combining Prefix with a limited result set is the optimal approach. Using Contains in this scenario is a common mistake, as it scans more data and can lead to noticeable performance slowdowns, especially on large datasets.

      Filter 8: Suffix — Ends-With Matching

      The scenario: You want all products whose name ends with a specific term. Think variant suffixes like “-XL” or “-REFURBISHED”, file type indicators, or naming conventions where a specific qualifier always appears at the end.

      Suffix is the mirror of Prefix. The wildcard goes before the value — LIKE '%value'.

      SQL under the hood: WHERE name LIKE '%Lightweight'

      PHP Criteria

      				
      					$criteria = new Criteria();
      $criteria->addFilter(new SuffixFilter('name', 'Lightweight'));
      				
      			

      API Criteria

      				
      					{
          "filter": [
              {
                  "type": "suffix",
                  "field": "name",
                  "value": "Lightweight"
              }
          ]
      }
      				
      			

      Real-World Shopware 6 Filter Combinations You’ll Actually Use


      Theory is one thing. Here’s what filter combinations look like in actual Shopware Development projects.

      Show all active products in a price range that aren’t out of stock:

      				
      					$criteria = new Criteria();
      $criteria->addFilter(new EqualsFilter('active', true));
      $criteria->addFilter(
          new RangeFilter('price', [
              RangeFilter::GTE => 20,
              RangeFilter::LTE => 200
          ])
      );
      $criteria->addFilter(
          new NotFilter(
              NotFilter::CONNECTION_AND,
              [new EqualsFilter('stock', 0)]
          )
      );
      				
      			

      Find products from multiple manufacturers that contain a keyword:

      				
      					$criteria = new Criteria();
      $criteria->addFilter(
          new MultiFilter(
              MultiFilter::CONNECTION_AND,
              [
                  new ContainsFilter('name', 'Lightweight'),
                  new EqualsAnyFilter('manufacturerId', [
                      'abc123',
                      'def456',
                      'ghi789'
                  ])
              ]
          )
      );
      				
      			

      Shopware 6 Filters + Aggregations: The Duo That Powers Layered Navigation


      Filters don’t work in isolation on a real storefront. They work hand-in-hand with Shopware aggregations. Here’s what that means practically:

      When a customer selects “Price: €50–€150″ in your storefront filter panel, two things happen simultaneously. First, a filter narrows the product result set to that price range. Second, an aggregation recalculates the counts next to every other filter option , so the size options, color options, and manufacturer options update dynamically to reflect only what’s available within that price band.

      That real time faceted navigation, the feature that makes Shopware storefronts feel fast and intuitive, is powered by filters and aggregations working together within the same Criteria object.

      				
      					$criteria = new Criteria();
      $criteria->addFilter(new RangeFilter('price', [
          RangeFilter::GTE => 50,
          RangeFilter::LTE => 150
      ]));
      $criteria->addAggregation(
          new StatsAggregation('price-range', 'price')
      );
      $criteria->addAggregation(
          new TermsAggregation('manufacturer-count', 'manufacturerId')
      );
      				
      			

      How Filters Connect to Shopware Twig Functions on the Storefront

      Here’s something many admin-focused guides miss: backend filters don’t automatically become storefront filters. You need a bridge through Twig and the listing page loader.

      When a category listing page loads, Shopware collects request inputs, builds a Criteria object with filters, runs the query, and passes results plus aggregation data to Twig, which renders the filter UI.

      So, if you’re adding a custom filter (e.g., “Ships within 24 hours”), you need to connect backend logic with storefront rendering.

      • Create a ListingFilterHandler that extends AbstractListingFilterHandler
      • Register it as a service with the shopware.listing.filter_handler tag
      • Handle the aggregation in aggregate() and the filter application in process()
      • Render it in your twig template using the filter data passed to the page

      The Shopware SEO URL twig function seo_url() also interacts here when filter selections are applied and the URL updates, properly configured SEO URLs ensure that filtered pages can be indexed by search engines rather than treated as duplicate content. This matters enormously for eCommerce SEO at scale.

      The Most Common Filter Mistakes We Fix at iCreative Technologies

       

      Mistake 1: Using Contains for everything. Developers reach for ContainsFilter because it “works” for partial matches. But on a 50,000-product catalog, Contains on every search input creates slow queries. The fix is using Prefix where possible, Elasticsearch for full-text search, and Contains only where genuinely needed.

      Mistake 2: Not understanding Multi vs top-level AND. Every filter added directly to $criteria->addFilter() is ANDed together at the top level. Developers who want OR logic between two conditions but don’t use MultiFilter end up with queries that return zero results because they’ve accidentally required both conditions to be true simultaneously.

      Mistake 3: Hardcoding filter values that should be dynamic. Hardcoding new EqualsFilter('active', true) in ten different places means that if the business logic changes, you’re hunting through ten files. Centralise filter logic in dedicated services.

      iCreative Technologies — Germany’s Leading Shopware Development Agencyices.


      If you’ve read this far, you now understand Shopware 6 filters better than most developers who’ve been working with the platform for months. But understanding filters is one thing.

      We are a Shopware Development Company based in Germany, and Shopware is not a sideline for us , it’s our core.

      Our team of experienced Shopware 6 developers has built stores, custom plugins, headless frontends, B2B portals, and ERP integrations on Shopware for clients across Germany, Austria, Switzerland, and beyond.

      What makes us different from other agencies:

      • 11+ years of hands-on Shopware real-world development expertise
      • Deep expertise in Shopware support, extensions, apps, and theme customization
      • High-quality work with reasonable Shopware development cost
      • End-to-end Shopware development expertise
      • Official Shopware partner agency
      • 24×7 Shopware support for your website

      Shopware Development Services (End-to-End Solutions)

      1. New Shopware Store Development
      We design and develop fully customized Shopware 6 stores built for performance, scalability, and conversions.

      2. Shopware 5 to Shopware 6 Migration
      Seamless migration with zero data loss, improved architecture, and enhanced performance using modern Shopware 6 capabilities.

      3. Custom Plugin Development
      Tailor-made Shopware plugins to extend functionality, automate workflows, and meet unique business requirements.

      4. Performance Optimization
      Speed up your store with advanced optimization techniques, including frontend improvements, database tuning, and Core Web Vitals enhancements.

      5. Headless Shopware Development
      Build flexible, API-first commerce experiences using headless architecture for better scalability and omnichannel reach.

      6. Ongoing Support & Maintenance
      Continuous monitoring, updates, and technical support to keep your Shopware store secure, stable, and future-ready.

      Shopware 6 Backend Filters: Quick Reference

       

      FilterPHP ClassAPI TypeSQL PatternUse When
      EqualsEqualsFilterequals= valueOne exact value match
      EqualsAnyEqualsAnyFilterequalsAnyIN (…)Match from a list
      ContainsContainsFiltercontainsLIKE ‘%value%’Partial text anywhere
      RangeRangeFilterrange>= x AND <= yNumbers, dates, prices
      NotNotFilternotNOT (…)Exclude conditions
      MultiMultiFiltermulti(A OR B) AND CGroup with OR logic
      PrefixPrefixFilterprefixLIKE ‘value%’Starts-with search
      SuffixSuffixFiltersuffixLIKE ‘%value’Ends-with search

      Final Thought

      The Shopware 6 filter system is powerful and precise. Most challenges come from choosing the right filters and managing performance at scale, not the system itself.

      This guide helps you structure complex queries effectively. Save it, share it with your team, and use it as a reference.

      When you need a Shopware Development Agency that gets these details right from the start, you know where to find us.

      Related Blogs

      Top 5 Shopify Development Companies in Bangalore (2026 Edition)

      Top 5 Shopify Development Companies in Bangalore (2026 Edition)

      Bangalore, India, is one of the fastest-growing tech hubs for IT agencies […]

      How to Install Mage-OS on Your Server: Step by Step Setup Guide (2026)

      How to Install Mage-OS on Your Server: Step by Step Setup Guide (2026)

      TL;DR Mage-OS is a free, community driven, drop in alternative to Magento […]

      What is MageOS? The Complete Guide to the Community Driven Open Source Commerce Platform

      What is MageOS? The Complete Guide to the Community Driven Open Source Commerce Platform

      TL;DR Mage OS is a free, open source distribution of Magento, built […]

      Get Instant AI summary of this post:

      ChatGPT Perplexity