Repository navigation
Render the price filter on the taxon listing again - #300
Merged
Wojdylak merged 1 commit intoOct 16, 2026
Merged
Conversation
The sidebar of the taxon listing renders the facets of the filter form and closes it with `render_rest: false`, so the
`price` child of `ShopProductsFilterType` — the min and max inputs that `HasPriceBetweenQueryBuilder` reads — never
reaches the page. The filter itself works: `?price[min_price]=25&price[max_price]=35` narrows the results, and the
documentation promises the control ("here user can also filter the results by the minimum and maximum price"), but there
is no way to reach it from the shop. In 1.x the same sidebar rendered `form_row(form.price)` next to the options and the
attributes.
The row is rendered again, in its own container. Since the facets submit themselves on change and the form has no submit
button, `ElasticSearchCheckboxChangeSubmit` now watches the price container as well: it submits when the focus leaves the
container and the values changed, or when Enter is pressed inside it. Moving between the min and the max field keeps the
focus inside the container, so filling both fields sends one request, not two.
pbalcerzak
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
On the taxon listing the price filter is unreachable. Adding
?price[min_price]=25&price[max_price]=35to the URLnarrows the results correctly, but the shop renders no control for it.
ShopProductsFilterTypebuilds the field:templates/Shop/TaxonProductsSearch/content/body/sidebar/facets.html.twigrendersform.facetsonly, and closes theform with
render_rest: false, which hides the leftover fields instead of drawing them.priceis not a facet — facetscome from the aggregations of the registered facets,
priceis a plain child of the form — so the loop never reaches it.In
1.xthe same sidebar rendered it explicitly, next to the options and the attributes:The
2.0rewrite of the view replaced the submit button with the auto-submitting checkboxes and lost the price row alongwith it.
doc/functionalities.mdstill promises the control: "here user can also filter the results by the minimum andmaximum price".
The fix
The price row is rendered again, in its own container:
{% if form.price is defined %} <div class="bitbag-sylius-elasticsearch-plugin-price-filter"> {{ form_row(form.price) }} </div> {% endif %}There is no submit button in the form any more, so
ElasticSearchCheckboxChangeSubmitwatches the container too:Enterinside the container submits it,The checkbox behaviour is untouched, and the class keeps its name so nothing importing it breaks.
Tested
Against a Sylius 2.2 shop with this plugin:
Min priceandMax priceunder the attribute facets?price[min_price]=20&price[max_price]=50, 9 products narrowed to the 2 in range, both fields keep their valuesThe submit behaviour was exercised in a browser against the built class: leaving the container untouched submits nothing,
moving from min to max submits nothing, leaving the container after editing submits once,
Entersubmits, and a checkboxstill submits as before.