-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default tax class rate to the price index #1003
base: master
Are you sure you want to change the base?
Conversation
@romainruaud I submitted this PR a while ago and I am wondering what you think about it. Is there anything I have to fix? |
Hello @nicobatty to me it's quite unclear what you are trying to achieve here. I see that you calculate on-the-fly the product prices according to their tax class id, but I do not understand the reason behind this. Maybe you can give me more details about it. Also, it may be due to a custom tax configuration by your side, so would you mind posting a screenshot of your tax configuration in the Magento Back-Office ? I suppose there is something related with the way to display product price (incl or excl tax), and things like this. Best regards |
Hi @romainruaud, Sure no problem I can explain this to you. Basically, in Magento you have two configurations:
Magento by default is using the "Including Tax" for the "Catalog Prices" config, in this case the the issue is that the Price indexer for ElasticSuite is taking the raw price in the It might be easier to explain with an example:
This is what Magento does basically. The issue is that the current implementation of the price indexer for ElasticSuite is taking the raw You can also check the |
@nicobatty @romainruaud We have the same problem here in Germany. Looks like a good idea to index the prices with tax if possible for France and Germany. |
Hello, @nicobatty Did you find au solution please ? We have this problem too with multi taxes. |
Hi @kevinvuillemin, I no longer work on Magento projects but this PR should do the trick. At least it used to work back when I did this change and it was used on a multistore / multitax website that was doing B2C and B2B. All it really does is add the I think you are probably better off patching these changes since it will probably never going to be merged. The use case is specific to those using untaxed price by default and @romainruaud don't like the fact that the price is being recalculate here. The problem is, it is not calculate anywhere otherwise we wouldn't be using the price index as a reference. I explained the issue in detail on this PR so if you want to patch it in an other way you are free to do it. |
28eb80b
to
3cbc361
Compare
Hi!
This PR is related to this issue: #571
This is an attempt at fixing the price index so that it includes the default store tax.
In order to recover this tax, I added the
tax_class_id
to the price index request to limit the performance impact.I'm not yet sure about the
$this->taxCalculation->getCalculatedRate
call in terms of performance, though it seems like the rate recovery is cached:https://github.com/magento/magento2/blob/50f974b0c8f3ada8d7a2c9b0f9924976dacd2088/app/code/Magento/Tax/Model/Calculation.php#L362-L378