elasticsuite
elasticsuite copied to clipboard
Filter price including Taxes (VAT)
Hello,
The catalog search show the product list with prices inluding taxes, but the price filter show the values without taxes.
Do you know if is possible to show the price slider with taxes please ?
PS : In the configuration, all prices options are displayed with "include taxes". We have VAT in france ;-)
To be honest, there is most probably something strange on your Magento instance, probably in the taxes configurations or in the display configuration for taxes.
We are in France too, and already done a lot of projects with ElasticSuite and we never faced this issue.
Can you give us more details :
- screenshot of all taxes related configurations
- your exact use case, what you have in the catalog_product_index_price table for the products you are speaking about.
Best regards
Possible relation to #1003
You can see my taxes configurations and search results in the catalog :


That's exactly what we had in one of our shops. We fixed that with a module which overwrites the price value in the index by respecting the default tax class. See PR #1003.
Yes but we have several taxes you kow ?
@kevinvuillemin you mean, several taxes per product?
I don't understand why "Catalog Prices : Excluding taxes".
Afaik we always consider that product prices are "incluging TVA" when contributing a product in the BO.
But that explain your bug, clearly, basically, we index into Elasticsearch what is stored into the catalog_product_price_index table.
So if product prices are created excluding taxes, this would lead to this table to contain excluding taxes data => will be indexed as is in Elasticsearch after.
Regards
I'm not a huge fan of #1003 implementation since it involves "recalculating" each product price during indexing.
I'd instead do this in javascript directly in the price slider, as we did previously for the multiple currencies : https://github.com/Smile-SA/elasticsuite/blob/2.8.x/src/module-elasticsuite-catalog/view/frontend/web/js/range-slider-widget.js#L45
@romainruaud In most of the B2B shops, the product prices are "excluding tax". I had a discussion with some Magento developers, years ago. IMHO the price index should contain the prices with and without tax. Magento does not understand that. They are developing in their demo store with demo data and US environment which needs tax only in the checkout. I am also not a big fan of the workaround of PR #1003. It solves in our case the problem. We have prices "excluding tax" and alway a 19% tax rate. It there are multiple rates, this will not work anymore. Then we need to re-calculate the price for every product during indexing process.
Hi I'm facing the same issue too :/
@romainruaud
I don't understand why "Catalog Prices : Excluding taxes".
Afaik we always consider that product prices are "incluging TVA" when contributing a product in the BO.
But that explain your bug, clearly, basically, we index into Elasticsearch what is stored into the
catalog_product_price_indextable.So if product prices are created excluding taxes, this would lead to this table to contain excluding taxes data => will be indexed as is in Elasticsearch after.
Regards
I thought about setting the price "including VAT" but I was wondering if we save the product including VAT, and for some reason we need to change the amount of the VAT, the price of the product won't change and will be wrong ? (I don't know if you will follow me ;) trying to give an exemple: My product price: 100€ (incl. VAT 20%) I change the VAT to 10%, the price of the product will stay at 100€ ? That why I wonder if during the indexation we could have the both price incl. VAT and excl. VAT. For the JS solution I don't follow you. Because some product could be at 10% and other at 20% and I'm talking about store which manage B2C and B2B on the same website. Hope I'm clear enough :)
Up please.
The b2c catalog needs a filter price with the taxes beacause we show the products all taxes included and not without taxe
Hello @romainruaud,
There are at least two projects at Smile which use the Catalog Prices = Excluding Tax configuration. Currently the https://github.com/Smile-SA/elasticsuite/pull/1003 is applied on them.
This the PR has the following disadvantages:
- it doesn't work with multiple tax rates
- it doesn't work with Magento EE/Cloud (there should be a bit different JOIN by
row_idinstead ofentity_id) - it fixes price filter bug for taxable countries but creates it for non taxable countries.
So there is a real demand on a proper solution without issues described above.
Just an idea - is it possible to resolve the issue by doing a king of price adjustment between filter component and elasticsearch query? For example:
- Tax Rate: 20%
- Product price without tax: 125 EUR
- User see it as 150 EUR in catalog (125 * 1.2 = 150) because his address in the taxable country.
- User filters by price range 130 - 160
- Elasticsuite excludes tax from price and performs elasticsearch query with the range: {130/1.2 - 160/1.2} = {108.33 - 133.33}
- Result: the product is found, because the 125 is in searched range {108.33 - 133.33}