Fix: Allow to fetch tax class ID for NOT LOGGED IN customer group
Description (*)
When using \Magento\Catalog\Helper\Data::getTaxPrice to fetch price, tax details are miscalculated for context with guest users.
Here the group id 0 was interpreted as NULL while it shouldn't.
Contribution checklist (*)
- [ ] Pull request has a meaningful description of its purpose
- [ ] All commits are accompanied by meaningful commit messages
- [ ] All new or changed code is covered with unit/integration tests (if applicable)
- [ ] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
- [ ] All automated tests passed successfully (all builds are green)
Resolved issues:
- [x] resolves magento/magento2#39850: Fix: Allow to fetch tax class ID for NOT LOGGED IN customer group
Hi @thomas-kl1. Thank you for your contribution! Here are some useful tips on how you can test your changes using Magento test environment. :exclamation: Automated tests can be triggered manually with an appropriate comment:
-
@magento run all tests- run or re-run all required tests against the PR changes -
@magento run <test-build(s)>- run or re-run specific test build(s) For example:@magento run Unit Tests
<test-build(s)> is a comma-separated list of build names.
Allowed build names are:
-
Database Compare -
Functional Tests CE -
Functional Tests EE -
Functional Tests B2B -
Integration Tests -
Magento Health Index -
Sample Data Tests CE -
Sample Data Tests EE -
Sample Data Tests B2B -
Static Tests -
Unit Tests -
WebAPI Tests -
Semantic Version Checker
You can find more information about the builds here :information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.
For more details, review the Code Contributions documentation. Join Magento Community Engineering Slack and ask your questions in #github channel.
@magento create issue
@magento run all tests
@magento run all tests
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Integration Tests, Unit Tests
Hello @thomas-kl1,
Gentle reminder for this PR.
Thank you.
@engcom-Hotel it's on my todo list!
Updated the test coverage in integration test to cover the PR changes.
@magento run all tests
Hello @thomas-kl1,
Thanks for the contribution!
The code changes seems fine to us, but please add/update the automated test with the modified logic.
Thanks
@engcom-Hotel, I have taken care of the test coverage and the static test failures, requesting for the review.
@magento run all tests
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE
Hi @thomas-kl1,
Thanks for the collaboration & contribution!
:heavy_multiplication_x: QA not Passed
We have tried to reproduce the issue and the issue was reproducible but after taking PR changes still tax not getting applied for NOT LOGGED IN Customer.We have tried with the below steps :
Could you please let us know still if we are missing anything.
Thanks.
@engcom-Bravo Hello, regarding your screenshots I'm not sure to understand what the issue is, you've setup a 0 tax for guests. I don't see any tax details in the order summary, so it seems there is no tax as exepected.
Did you enabled Display Zero Tax Subtotal?
Hi @thomas-kl1,
Thanks for your Contribution!!.
We have tried to reproduce the issue in Latest 2.4-develop instance we are able to reproduce the issue but after taking PR changes still tax not getting applied for NOT LOGGED IN Customer.We have tried with the below steps :
Created Tax Zones and Rates :
Created a Tax Rule for NOT LOGGED IN Customer with 10% Tax :
Tax was still not getting applied for NOT LOGGED IN Customer.
As discussed over the slack we need more information regarding steps to reproduce and please let us know if we are missing anything here and also Could you please resolve the conflicts to proceed further
Thanks.