magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.31k forks source link

Discount amount (based on coupon code) displays misleading in cart (excl./incl. VAT) #34959

Open anderspirlo opened 2 years ago

anderspirlo commented 2 years ago

Preconditions (*)

  1. Tested on Magento ver. 2.4.3-p1.

Steps to reproduce (*)

Tax settings - set Catalog Prices under Calculation settings to excluding tax.
Tax settings - set Apply Discount On Prices under Calculation settings to excluding tax.
Tax settings - set Display Product Prices In Catalog under Price Display Settings to including tax.
Tax settings - set Display Prices under Shopping Cart Display Prices to including tax.
Tax settings - set Display Subtotal under Shopping Cart Display Prices to including tax.
Tax settings - set Display Shipping Amount under Shopping Cart Display Prices to including tax.

I created a Cart price rule with a coupon code, where it gives an discount of 10% without any product conditions. Go to frontend and add a product to cart. Go to cart page and apply coupon code and look at cart summary. Product Price: $50 Tax: 10% Coupon: 10% Shopping Cart Page display: Since display settings set to including tax. displayed as $55 Since Apply Discount set to Excluding tax: 50 - (10% of 50) = 50 - 5 = 45 Since Apply tax set to After discount : 45 + (10% of 45) = 45 + 4.5 = 49.5 Discount displayed: $5 Tax displayed: 4.5 But since Price display settings set to including tax: Subtotal = 55 (Including tax) Discount also should be displayed including tax: 10% of 55 = 5.5 Total = 55 - 5.5. = 49.5

Expected result (*)

  1. Discount amount (based on coupon code) displayed incl. VAT, as all other amounts is including VAT.
  2. Expected behaviour is, that Discount amount (based on coupon code) is based on Tax Settings for either Display Product Prices In Catalog under Price Display Settings or Display Prices under Shopping Cart Display Prices.

Actual result (*)

  1. Discount amount (based on coupon code) displays excl. VAT.
  2. Actual VAT calculation is correct, but the amount is misleading. image

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

m2-assistant[bot] commented 2 years ago

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

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.


: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.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

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

anderspirlo commented 2 years ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 2 years ago

Hi @anderspirlo. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 years ago

Hi @anderspirlo, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

anderspirlo commented 2 years ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 2 years ago

Hi @anderspirlo. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 years ago

Hi @anderspirlo, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

m2-assistant[bot] commented 2 years ago

Hi @engcom-November. 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:

engcom-November commented 2 years ago

Hi @anderspirlo , Thank you for reporting and collaboration. Verified the issue on Magento 2.4-develop branch but cannot able to reproduce the issue. Since Price display settings are set to including tax, subtotal is displayed including tax before discount value. Hence breakup details are not matching which is an existing behavior of Magento but not a bug. image

Display settings set to excluding tax: image

Kindly recheck the issue on Magento 2.4-develop branch and elaborate steps to reproduce if you are still facing issues. Thank you.

anderspirlo commented 2 years ago

Hi @engcom-November

Thanks for the quick reply. In your first screenshot as far as, I can see, you replicate my settings correctly, The discount amount displays 5,00 USD (excl. VAT), allthough the correct amount for display should be 5,50 USD incl. VAT.

You write: Hence breakup details are not matching which is an existing behavior of Magento but not a bug.

So this is created by design? I believe it confuses a customers massively, when every amount is including VAT except the discount amount provided in this case.

m2-assistant[bot] commented 2 years ago

Hi @engcom-Hotel. 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:

engcom-Hotel commented 2 years ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 2 years ago

Hi @engcom-Hotel. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 years ago

Hi @engcom-Hotel, here is your Magento Instance: https://1d4c83cb3eac88f23c90c3d5e2042022.instances.magento-community.engineering Admin access: https://1d4c83cb3eac88f23c90c3d5e2042022.instances.magento-community.engineering/admin_0429 Login: 26872fa9 Password: 1480c2dfa962

engcom-Hotel commented 2 years ago

Hello @anderspirlo,

I think I am able to get the expected result mentioned in the main description. Please refer my screenshot below for reference:

image

For this, I made additional steps as below:

Please let us know in case we have missed anything.

Thanks

anderspirlo commented 2 years ago

Hello @engcom-Hotel

Your screenshot shows the expected result/outcome.

But you can only archive this by applying the following settings:

This would force, that you can only display the correct amount, if catalog prices are including tax, which is not the preferred setting in Magento, as you want this to be excl. tax, to for example be able to integrate other systems.

engcom-Hotel commented 2 years ago

Hello @anderspirlo,

Thanks for the reply!

We request you to please elaborate below expected result from the main description:

2. Expected behaviour is, that Discount amount (based on coupon code) is based on Tax Settings for either Display Product Prices In Catalog under Price Display Settings or Display Prices under Shopping Cart Display Prices.

Thanks

anderspirlo commented 2 years ago

Hello @engcom-Hotel

Thanks for the reply.

I set up a scenario on the Magento instance available: https://1d4c83cb3eac88f23c90c3d5e2042022.instances.magento-community.engineering/

I use this product for a test: https://1d4c83cb3eac88f23c90c3d5e2042022.instances.magento-community.engineering/fusion-backpack.html

Geo, VAT and Sales settings:

Basic settings:

Marketing settings:

Usecase

billede

Now - hereby expected result in summary on cart page is:

Subtotal: 59,00 (incl. tax) Discount: 5,90 (incl. tax) Shipping: 0,00 (incl. tax)

Tax: 10,62

Order total: 53,10 (incl. tax)

Actual result is:

Subtotal: 59,00 (incl. tax) Discount: 4,72 (EXCL. TAX) Shipping: 0,00 (incl. tax)

Tax: 10,62

Order total: 53,10 (incl. tax)

It seems whether the discount amount (placeholder) is displayed incl. or excl. tax is ONLY controlled by the setting:

Which makes is impossible to display a discount amount incl. tax (which would be the natural display for a b2c customer), if you have created all your products in your admin excl. tax, which is the prefferred solution.

I would expect that the discount amount would be controlled by this setting: Tax settings - set Display Product Prices In Catalog under Price Display Settings to including tax. or Tax settings - set Display Prices under Shopping Cart Display Prices to including tax.

... as these two settings actual refer to "display of pricing". I see the discount amount as a pricing field.

I need to underline, that the actual result also shows in the order backend, which I also would argue is misleading.

anderspirlo commented 2 years ago

Hello @engcom-Hotel

Another comment. If you recalculate the actual result, it should display the following change in tax and order total:

Subtotal: 59,00 (incl. tax) Discount: 4,72 (EXCL. TAX) Shipping: 0,00 (incl. tax)

Tax: 10,86

Order total: 54,28 (incl. tax)

Which is INCORRECT.

engcom-November commented 2 years ago

Hi @anderspirlo , Verified the issue again on Magento 2.4-develop branch with tax configuration as per comment. Please find the findings/observations below:

Product Price: $50 Tax: 10% Coupon: 10% Shopping Cart Page display: Since display settings set to including tax. displayed as $55 Since Apply Discount set to Excluding tax: 50 - (10% of 50) = 50 - 5 = 45 Since Apply tax set to After discount : 45 + (10% of 45) = 45 + 4.5 = 49.5 Discount displayed: $5 Tax displayed: 4.5 image

But since Price display settings set to including tax: Subtotal = 55 (Including tax) Discount should be 10% of 55 = 5.5 Total = 55 - 5.5. = 49.5 Hence confirming the issue.

github-jira-sync-bot commented 2 years ago

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

m2-assistant[bot] commented 2 years ago

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

engcom-November commented 1 year ago

Hi @anderspirlo , We reviewed the issue again and after internal discussions and confirmation from PO, we are considering this as feature request. Currently in order to be able to see the discount amount calculated including Tax amount is to set the catalog product prices including tax, other wise it would be a feature request where we need to add additional configuration option in the "Shopping Cart Display Settings" section - something like "Display Discount Amount" - Including or Excluding Tax. Thank you.

hnsr commented 11 months ago

@engcom-November Thanks for confirming the issue - we're also running into this in a very similar setup as @anderspirlo , and implementation of this feature/configuration would help us avoid customer confusion about the applied discounts.