Open
Description
This issue is automatically created based on existing pull request: #39822: 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 purposeAll commits are accompanied by meaningful commit messagesAll 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 updateAll automated tests passed successfully (all builds are green)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Ready for Development
Activity
engcom-November commentedon May 22, 2025
Hello @thomas-kl1 ,
Thank for your report and collaboration.
However, we’re currently unable to identify the exact issue. Could you please provide the following details to help us review it more effectively:
This information will greatly assist us in understanding and addressing the issue.
Hence marking this issue as "Needs Update"
Thank you!
thomas-kl1 commentedon May 22, 2025
When Magento render the product price on the frontend, it completely ignore the tax class ID for the customer group "Not Logged In", if the visitor is a guest. The tax class is then resolved from the product as default.
The fix is really easy as seen in the suggested change, it's because the comparison implicitly cast the customer group ID "0" as null. That's why the strict comparison is necessary.