adobe / aem-core-cif-components

A set of configurations and components to get you started with AEM Commerce development
Apache License 2.0
103 stars 80 forks source link

Prices not shown if specific permissions per customer group is configured #914

Closed danielkoch closed 2 years ago

danielkoch commented 2 years ago

Expected Behaviour

Prices should be shown correctly even if specific permissions per customer group for prices are set in Magento.

Actual Behaviour

Prices GraphQL request sent without the authorization: 'Bearer xyz'. Therefore Magento not responses with prices.

Possible solution/idea: If available include authorization header with Bearer token from Cookie cif.userToken or local storage item M2_VENIA_BROWSER_PERSISTENCE__signin_token with https://github.com/adobe/aem-core-cif-components/blob/core-cif-components-reactor-2.4.0/ui.apps/src/main/content/jcr_root/apps/core/cif/clientlibs/common/js/CommerceGraphqlApi.js#L52-L55 in _fetchGraphql method.

Reproduce Scenario (including but not limited to)

Always if open a product detail page

Steps to Reproduce

  1. In Magento: Change the product price visibility in the category configurations to a specific permissions (per customer group)
  2. Login to be authorized with a Magento user
  3. Open product detail page

Platform and Version

AEM v6.9 Magento Cloud CIF components, v2.4.0

Sample Code that illustrates the problem

No example needed. Just provide the configuration above

Logs taken while reproducing problem

No logs. Prices returned with value -1

buuhuu commented 2 years ago

@adobe export issue to Jira project CIF as Bug

github-jira-sync-bot commented 2 years ago

:white_check_mark: Jira issue CIF-2903 is successfully created for this GitHub issue.