Blog Sections Open

Building a Price Range Filter for Ditto with andFilter

A practical approach to range filtering in Evolution CMS catalogs built with Ditto and TV-backed price data.

Filtering a Ditto catalog by price range is a classic Evolution CMS task. It also exposes the limits of plain TV matching, because a price filter is not about equality. It is about numeric comparison.

The source question pointed to using the andFilter extender with TV-based product data. That is a workable direction as long as the price TV is stored consistently and treated as numeric data.

What matters most

  • The price TV should contain clean numeric values without currency text.
  • The filter should normalize the “from” and “to” inputs before building the query.
  • Missing boundaries should degrade gracefully, for example “from only” or “to only”.

A practical strategy

Use one layer to validate the request values, then pass a composed filter into Ditto or its extender. Keep formatting separate from filtering: prices should be compared as numbers and only formatted for display afterward.

Common mistake

Do not store values such as 1 200 руб. directly in the price TV if that same field is meant to be filtered numerically. Human formatting belongs in output, not in storage.

For older Evo shops this pattern is still valid: a clean numeric TV plus an explicit range filter will always be more dependable than trying to parse decorative price strings inside the query logic.

Newer post

Running City Subdomains from One Evolution CMS Structure

How to map subdomains such as city.example.com to top-level Evolution CMS resources while keeping shared page paths, robots files, and routing under control.

Older post

Choosing the Right Catalog Structure in Evolution CMS

How to think through catalog architecture in Evolution CMS when products arrive from spreadsheets and the site must stay maintainable for editors and frontend developers.