Skip to content

[Issue] Fix: Allow to fetch tax class ID for NOT LOGGED IN customer group #39850

Open
@m2-assistant

Description

@m2-assistant

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 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)

Activity

added
Priority: P2A defect with this priority could have functionality issues which are not to expectations.
on Apr 22, 2025
engcom-November

engcom-November commented on May 22, 2025

@engcom-November
Contributor

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:

  • A clear description of the issue
  • Steps to reproduce it
  • Expected vs. actual results
  • A screencast or screenshots, if possible

This information will greatly assist us in understanding and addressing the issue.

Hence marking this issue as "Needs Update"

Thank you!

thomas-kl1

thomas-kl1 commented on May 22, 2025

@thomas-kl1
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: needs updateAdditional information is require, waiting for responsePriority: P2A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.xIndicates original Magento version for the Issue report.

    Type

    No type

    Projects

    Status

    Ready for Development

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @thomas-kl1@engcom-Bravo@engcom-November

      Issue actions

        [Issue] Fix: Allow to fetch tax class ID for NOT LOGGED IN customer group · Issue #39850 · magento/magento2