Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento 2.3.5-p1 - Discount Description, Coupon Codes on Invoices Broken #28432

Open
1 of 5 tasks
kdjmonaghan opened this issue May 29, 2020 · 18 comments
Open
1 of 5 tasks
Labels
Area: Order Component: Sales Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: ready for dev Reported on 2.3.5-p1 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@kdjmonaghan
Copy link

kdjmonaghan commented May 29, 2020

Preconditions (*)

  1. Magento 2.4-develop
  2. Magento 2.3.5-p1 Installation
  3. Valid Coupon with a Description

Steps to reproduce (*)

  1. Create valid Coupon with Description Populated (fill the description with say 200 characters for emphasised issue)

Screenshot from 2020-12-04 15-18-14

  1. Create an Order using said Coupon
  2. View Order in CMS at Discount Line (discount line description has changed from hisitoric orders, to be the coupon description)
  3. Generate Invoice (Invoice discouunt line has also changed)
  4. Print PDF (Discount line does not show Coupon Code anymore, but the description)

Expected result (*)

  1. Coupon Code to be shown in Description on Order, Invoice and Invoice PDF

Actual result (*)

  1. Coupon Code is missing from Order, Invoice and Invoice PDF as Discount Description column is now being populated with the description field and not the invoice when Description is populated.

Screenshot from 2020-12-04 15-24-10

Note: If the coupon is without a description then the coupon code is displayed

2020-12-04_15-31


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

  • 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”.
@m2-assistant
Copy link

m2-assistant bot commented May 29, 2020

Hi @kdjmonaghan. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

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

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

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

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


@ghost ghost added this to Ready for QA in Community Backlog May 29, 2020
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label May 29, 2020
@kdjmonaghan
Copy link
Author

kdjmonaghan commented May 29, 2020

For users who seek a fix until Magento either make an option for this in an update, or, make a merge request for this;

Your discount_description field is being populated with the Coupon's description now where as previously in older versions of Magento it was using coupon_code and never actually checked for the presence of the Coupon's description to populate this field.

In recent builds of Magento, Magento have 'fixed' this issue (causing your legacy orders invoices contents data to not match the expected result of new orders, where your legacy orders were 'correct' before) - this results in the coupon code used not being present anywhere to the normal Admin user who does not know how to look up the Coupon Code used within the Order, easily.

The following file is the issue within Vendor:

vendor/magento/module-sales-rule/Model/RulesApplier.php

Look for the addDiscountDescription method and you will see there is a new condition added for setting the Coupon Code Description to the $label variable after the getCouponCode check.

Previously this method, addDiscountDescription looked like this, and you're going to have to replace it via an Extension or Plugin to get it to work as it did before. Comparing the below to what's in this file now will show you the change:

    public function addDiscountDescription($address, $rule)
    {
        $description = $address->getDiscountDescriptionArray();
        $ruleLabel = $rule->getStoreLabel($address->getQuote()->getStore());
        $label = '';
        if ($ruleLabel) {
            $label = $ruleLabel;
        } else {
            if (strlen($address->getCouponCode())) {
                $label = $address->getCouponCode();
            }
        }

        if (strlen($label)) {
            $description[$rule->getId()] = $label;
        }

        $address->setDiscountDescriptionArray($description);

        return $this;
    }

You're going to have to either make a Plugin or extend this module and replace this method within the class to have the original functionality work as the way it did in previous releases of Magento 2.

Your invoices templates, by default, aren't expecting, or formatted, to handle a long description that you can enter into the Discount Description field. This may have been patched as a 'long term bug' (it probably was intended to work like this) but can cause frustration for those expeccting the base functionality to work as it has in previous iterations.

@kdjmonaghan kdjmonaghan changed the title Magento 2.3.5 - Discount Description, Coupon Codes on Invoices Broken Magento 2.3.5-p1 - Discount Description, Coupon Codes on Invoices Broken May 29, 2020
@krishprakash krishprakash self-assigned this May 30, 2020
@m2-assistant
Copy link

m2-assistant bot commented May 30, 2020

Hi @krishprakash. 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: 👇

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

  • 2. 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.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. 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!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@krishprakash
Copy link

@magento give me 2.4-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @krishprakash. Thank you for your request. I'm working on Magento 2.4-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @krishprakash, here is your Magento instance.
Admin access: https://i-28432-2-4-develop.instances.magento-community.engineering/admin_043f
Login: 4087a0e1 Password: 86b17b7cf138
Instance will be terminated in up to 3 hours.

@sidolov sidolov added this to Ready for Grooming in Low Priority Backlog Sep 24, 2020
@m2-community-project m2-community-project bot moved this from Ready for Grooming to Dev In Progress in Low Priority Backlog Sep 24, 2020
@ghost ghost unassigned krishprakash Oct 8, 2020
@m2-community-project m2-community-project bot moved this from Dev In Progress to Ready for Grooming in Low Priority Backlog Oct 8, 2020
@sidolov sidolov added this to Ready for Confirmation in Issue Confirmation and Triage Board Oct 21, 2020
@ghost ghost removed this from Ready for QA in Community Backlog Oct 21, 2020
@ghost ghost removed this from Ready for Grooming in Low Priority Backlog Oct 21, 2020
@ghost ghost added Issue: ready for confirmation and removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Oct 21, 2020
@magento-engcom-team magento-engcom-team added the Reported on 2.3.5-p1 Indicates original Magento version for the Issue report. label Nov 13, 2020
@engcom-Alfa engcom-Alfa self-assigned this Dec 4, 2020
@m2-assistant
Copy link

m2-assistant bot commented Dec 4, 2020

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

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

  • 2. 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.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. 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!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

Copy link

m2-assistant bot commented May 22, 2024

Hi @engcom-Bravo. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

    1. Add/Edit Area: XXXXX label to the ticket, indicating the functional areas 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!
    1. If the issue is not relevant or is not reproducible any more, feel free to close it.

@m2-community-project m2-community-project bot moved this from Ready for Development to Dev In Progress in Low Priority Backlog May 22, 2024
@engcom-Bravo
Copy link
Contributor

@magento give me 2.4-develop instance

Copy link

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

Copy link

@engcom-Bravo engcom-Bravo removed Component: SalesRule Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Issue: ready for confirmation Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch labels May 22, 2024
@engcom-Bravo
Copy link
Contributor

HI @kdjmonaghan,

Thanks for your reporting and collaboration.

We have verified the issue in Latest 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.

Screenshot 2024-05-22 at 12 19 00

Coupon Code is missing from Order, Invoice and Invoice PDF as Discount Description column is now being populated with the description field and not the invoice when Description is populated.

Hence Confirming the issue.

Thanks.

@engcom-Bravo engcom-Bravo added Area: Order Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels May 22, 2024
@github-jira-sync-bot
Copy link

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

Copy link

m2-assistant bot commented May 22, 2024

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

@m2-community-project m2-community-project bot moved this from Dev In Progress to Ready for Development in Low Priority Backlog May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Order Component: Sales Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: ready for dev Reported on 2.3.5-p1 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Low Priority Backlog
  
Ready for Development
Development

Successfully merging a pull request may close this issue.

7 participants