magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Final price not considering store scope?

Open Aquive opened this issue 3 years ago • 2 comments

Preconditions and environment

  • Magento version 2.4.3-p2
  • 2 different websites with their stores and storeviews.

Steps to reproduce

  1. Add a product to the system for say €50
  2. Assign the product to both websites (website 1 and website 2)
  3. Make a new catalog rule with 50% off specific for the SKU of the added product, assign the catalog rule only to website 1
  4. Check the product in both frontends of website 1 and 2 to see if the prices are correct. Website 1 should list the product for €50. Website 2 should list it for €25.

Now spin up Magento 2 in a script and execute the following:

// Website 1
$product = $objectManager->create('Magento\Catalog\Model\Product')->setStoreId(1)->load(1);
echo $product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue() . PHP_EOL;

// Website 2
$product = $objectManager->create('Magento\Catalog\Model\Product')->setStoreId(2)->load(1);
echo $product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue() . PHP_EOL;

Expected result

I expect the final prices reflect the prices like the storefronts. So:

25 50

Actual result

The system doesn't seem to consider the scope when outputting the price. The output of the two lines of code is like this:

25 25

Additional information

No response

Release note

No response

Triage and priority

  • [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • [ ] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • [ ] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Aquive avatar Aug 10 '22 08:08 Aquive

Hi @Aquive. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] avatar Aug 10 '22 08:08 m2-assistant[bot]

Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
      DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
    1. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

m2-assistant[bot] avatar Aug 10 '22 10:08 m2-assistant[bot]

Hi @engcom-Echo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
      DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
    1. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

m2-assistant[bot] avatar Aug 17 '22 06:08 m2-assistant[bot]

Hello @Aquive,

Thanks for the report and collaboration!

We have tried to reproduce the issue in Magento 2.4-develop branch, but for us, the issue is not reproducible. followed steps. website1

image

website2 with apply the catalog price rule on particular SKU.

image

Please check if i missed anything and kindly check on Magento 2.4-develop branch and provide more information with exact steps and screenshot so that we can reproduce this issue.

Thanks

engcom-Echo avatar Aug 18 '22 10:08 engcom-Echo

Hi @engcom-Echo thanks for the effort.

The reported problem does not arise on the frontend. It does hover arise when trying to retrieve the prices in the codebase of Magento. I supplied the (simplified) lines in the report. Shouldn't those lines reflect the same price as in the frontend? Because they don't.

Aquive avatar Aug 18 '22 12:08 Aquive

Hello @Aquive,

Thanks for contribution and collaboration.

We have check on behalf of lines of code and getting the same price for both store on website 2 where we have apply the catalog price rule. Hence we are confirming the issue.

Steps to reproduced.

// Website 1
$product = $objectManager->create('Magento\Catalog\Model\Product')->setStoreId(1)->load(1);
echo $product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue() . PHP_EOL;

// Website 2
$product = $objectManager->create('Magento\Catalog\Model\Product')->setStoreId(2)->load(1);
echo $product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue() . `PHP_EOL;`

Please find the attached screen.

image

Thanks

engcom-Echo avatar Aug 19 '22 14:08 engcom-Echo

:x: Something went wrong. Cannot create Jira issue.

github-jira-sync-bot avatar Aug 19 '22 14:08 github-jira-sync-bot

:x: Something went wrong. Cannot create Jira issue.

github-jira-sync-bot avatar Aug 19 '22 15:08 github-jira-sync-bot

:x: Something went wrong. Cannot create Jira issue.

github-jira-sync-bot avatar Aug 23 '22 10:08 github-jira-sync-bot

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-6470 is successfully created for this GitHub issue.

github-jira-sync-bot avatar Aug 23 '22 11:08 github-jira-sync-bot

:white_check_mark: Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

m2-assistant[bot] avatar Aug 23 '22 11:08 m2-assistant[bot]