magento2
magento2 copied to clipboard
Final price not considering store scope?
Preconditions and environment
- Magento version 2.4.3-p2
- 2 different websites with their stores and storeviews.
Steps to reproduce
- Add a product to the system for say €50
- Assign the product to both websites (website 1 and website 2)
- Make a new catalog rule with 50% off specific for the SKU of the added product, assign the catalog rule only to website 1
- 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”.
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.
- Join Magento Community Engineering Slack and ask your questions in #github channel.
: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
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:
-
- Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
Details
If the issue has a valid description, the labelIssue: Format is validwill be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is validappears.
- Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
-
- Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
Issue: Clear Descriptionlabel to the issue by yourself.
- Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
-
- Add
Component: XXXXXlabel(s) to the ticket, indicating the components it may be related to.
- Add
-
- Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced 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!
- Verify that the issue is reproducible on
- Join Magento Community Engineering Slack and ask your questions in #github channel.
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:
-
- Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
Details
If the issue has a valid description, the labelIssue: Format is validwill be added to the issue automatically. Please, edit issue description if needed, until labelIssue: Format is validappears.
- Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
-
- Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
Issue: Clear Descriptionlabel to the issue by yourself.
- Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add
-
- Add
Component: XXXXXlabel(s) to the ticket, indicating the components it may be related to.
- Add
-
- Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced 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!
- Verify that the issue is reproducible on
- Join Magento Community Engineering Slack and ask your questions in #github channel.
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
website2 with apply the catalog price rule on particular SKU.
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
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.
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.
Thanks
:x: Something went wrong. Cannot create Jira issue.
:x: Something went wrong. Cannot create Jira issue.
:x: Something went wrong. Cannot create Jira issue.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-6470 is successfully created for this GitHub issue.
: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.