Open mdkdev opened 5 months ago
Hi @mdkdev. Thank you for your report. To speed up processing of this issue, 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@magento I am working on this
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.
Hi @engcom-Delta. 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:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Issue: Confirmed
once verification is complete. Hi @mdkdev ,
Verified the issue on latest 2.4.7 and 2.4-develop, it is reproducible.
Hence, Confirming the issue.
Steps to reproduce:-
1.Configure a simple product with a price 1000 2.Set a tier price with a percentage discount (50%) 3.Set custom option with at least two values, one of the price of the values to 0, and another one to a negative number -500. 4.Go to the frontend, and visit the product. 5.Select the negative custom option value, and the qty that was set on the 50% tier price.
Actual Result:
The tier price is calculated based on the original product price without the selected custom options.
(1000 - 500) - 500 = 0
Where 1000 is the original product price, 500 is the negative custom option value and the other 500 is 50% of the original product price (1000).
https://github.com/magento/magento2/assets/51681379/7b7b9b2b-e9d5-4c58-9d0d-fe191ad1952d
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-12004 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Delta. Thank you for verifying the issue.
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Hi @engcom-Delta,
Thank you for confirming the issue. The same problem occurs when a catalog price rule is set to (for example) a specific customer group. The discount is then deducted from the original price, which means that the following example results in a 0,- total:
Original Product Price: 1000.00 Cart Price Rule: -50% Custom Option Price: -500
Total Price: (1000 / 2) - 500 = 0.00
This should be a 50% discount on the configured product:
Total Price: (1000 - 500) / 2 = 250.00
https://github.com/magento/magento2/assets/6543944/4369a427-0f28-4175-bc36-7f001c4be20e
Should this be added to a new issue, or is this the right place?
Thank you.
@magento I am working on this
Hi @engcom-Delta,
Thank you for confirming the issue. The same problem occurs when a catalog price rule is set to (for example) a specific customer group. The discount is then deducted from the original price, which means that the following example results in a 0,- total:
Original Product Price: 1000.00 Cart Price Rule: -50% Custom Option Price: -500
Total Price: (1000 / 2) - 500 = 0.00
This should be a 50% discount on the configured product:
Total Price: (1000 - 500) / 2 = 250.00
magento_cart_price_rule_custom_options.mp4 Should this be added to a new issue, or is this the right place?
Thank you.
Hi @mdkdev ,
I have updated the main description and added the scenario in additional information.
Thanks,
Hi, I have looked into this issue. The problem is narrowed to 2 javascript files:
My understanding is: we want to inverse this calculation. We want instead the custom option prices to be performed first and then the tier prices would be adjusted after.
These 2 files have their logic intertwined with their UI. Some event subscribers seem to interact from one price to another price type.. I would like enquire on possible documentation to gain awareness of design/architecture around the price calculation on the product detail page. Would we have a diagram to understand the flow with the prices data and the UI on the product page?
Any news on a fix for this issue?
Apologies @JTielemans I have not had any inputs on the question I asked. I will unassign me so that it can leave someone else to work on it.
Preconditions and environment
Steps to reproduce
For a clear example, use the following numbers:
Product Price: 1000 Tier Price: 50% Discount Custom Option Value: -500
Expected result
The tier price discount is calculated on the price including the custom options. For example:
(1000 - 500) / 2 = 250
Where 1000 is the original product price, 500 is the negative custom option value and 2 is the 50% discount from the tier price.
Actual result
The tier price is calculated based on the original product price without the selected custom options.
(1000 - 500) - 500 = 0
Where 1000 is the original product price, 500 is the negative custom option value and the other 500 is 50% of the original product price (1000).
Additional information
Screencast: https://github.com/magento/magento2/assets/6543944/41b32739-a861-40b8-8a21-19c562a48c03
Scenario:2
The same problem occurs when a catalog price rule is set to (for example) a specific customer group. The discount is then deducted from the original price, which means that the following example results in a 0,- total:
Original Product Price: 1000.00 Cart Price Rule: -50% Custom Option Price: -500
Total Price: (1000 / 2) - 500 = 0.00
This should be a 50% discount on the configured product:
Total Price: (1000 - 500) / 2 = 250.00
magento_cart_price_rule_custom_options.mp4
Release note
No response
Triage and priority