Skip to content

#30255: Fixed "The coupon code has been accepted." message remains after a Coupon Code was removed #30391

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

Merged
merged 8 commits into from
Nov 13, 2020

Conversation

shikhamis11
Copy link
Member

Fixed #30255 "The coupon code has been accepted." message remains after a Coupon Code was removed

Preconditions

Create simple product

Create Customer with address

First Name: John
Last Name: Doe
Email Address: [email protected](use real mail)
Company: Magento
Address: 6161 West Centinela Avenue
City: Culver City
State/Province: California (CA)
Zip/Postal Code: 90230
Country: United States
Telephone: 555-55-555-55

Go to Admin -> Marketing -> Cart Price Rules: click "Add New Rule"

Fill all required fields
    "Coupon" select Specific Coupon
    "Coupon Code" = 1111
In "Action" section
    "Apply" select "Percent of product price discount"
    "Discount Amount" = 50
click "Save" button

Steps:

Go to admin -> sales -order -> create new order -> select customer
Add Products => simple product
Apply Coupon Code => 1111
remove Coupon Code

(/) Expected result
"The coupon code has been accepted." message should disappear

(x) Actual result
"The coupon code has been accepted." message is still present

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

…ains after a Coupon Code was removed

Fixed "The coupon code has been accepted." message remains after a Coupon Code was removed
@m2-assistant
Copy link

m2-assistant bot commented Oct 10, 2020

Hi @shikhamis11. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

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

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

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

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

@rodrigowebjump
Copy link
Member

@magento give me test instance

@magento-deployment-service
Copy link

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

@magento-deployment-service
Copy link

@milindsingh
Copy link
Member

#dmcdindia2020

@pramod-mishra
Copy link

#dmcdindia2020

@magento-engcom-team
Copy link
Contributor

@pramod-mishra thank you for joining. Please accept team invitation here and self-assign the issue.

@rodrigowebjump
Copy link
Member

Hi @shikhamis11 Thanks for your contribution.

Please could you cover your fix by autotests (MFTF)?
Thanks

@pramod-mishra
Copy link

@magento give me test instance

@magento-deployment-service
Copy link

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

@shikhamis11
Copy link
Member Author

@rodrigowebjump Thanks for the review . I am working on to add MFTF coverage for the issue

@magento-deployment-service
Copy link

@rodrigowebjump
Copy link
Member

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

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

@magento-deployment-service
Copy link

@rodrigowebjump
Copy link
Member

Hi @shikhamis11

Apparently the issue is being caused because there is no message returned when the coupon is removed.
A suggestion for this case is to return a message informing that the coupon was removed in the backend request process (like occurs in the storefront)

The current JS behavior does not remove the previous message if a empty is received in the response. Since there is a lot of requests happening there, my recommendation is to not change this behavior for now because we can create some undesirable
result.

@sivaschenko sivaschenko added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Oct 10, 2020
…ns after a Coupon Code was removed

reverted previous changes and updated requested changes
@shikhamis11
Copy link
Member Author

@magento give me test instance

Comment on lines 16 to 17
<severity value="CRITICAL"/>
<testCaseId value="MC-37386"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shikhamis11 could you please update severity and testCaseId?
Thank you.

            <severity value="AVERAGE"/>
            <testCaseId value="MC-38919"/>

updated `severity` and `testCaseId` for added MFTF test
@engcom-Charlie
Copy link
Contributor

@magento run all tests

Copy link
Contributor

@gabrieldagama gabrieldagama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @shikhamis11, I believe we might have an issue with the mftf, can you check it?

Comment on lines 40 to 41
<magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}"
stepKey="disableFlatRate"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe flat rate is enabled by default, by disabling it we may have made other tests flaky. I guess you can keep the CLI to enable it, but remove this one.

removed disable flat rate step from after action
@shikhamis11
Copy link
Member Author

@magento run all tests

@gabrieldagama
Copy link
Contributor

@magento run Functional Tests EE

@magento-engcom-team
Copy link
Contributor

Hi @gabrieldagama, thank you for the review.
ENGCOM-8426 has been created to process this Pull Request

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

@m2-assistant
Copy link

m2-assistant bot commented Nov 13, 2020

Hi @shikhamis11, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Component: Sales Event: dmcdindia2020 Partner: Cedcommerce partners-contribution Pull Request is created by Magento Partner Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept Progress: extended testing QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"The coupon code has been accepted." message remains after a Coupon Code was removed
9 participants