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

Bugfix: Discount amount getting doubled #1532

Merged
merged 1 commit into from
Apr 12, 2022
Merged

Conversation

dumega
Copy link
Contributor

@dumega dumega commented Apr 10, 2022

Description

Magento 2 has a bug with cart rule "Fixed amount discount for whole cart" and fixed in v2.3.6 (PR 26419) . So in M2 v2.3.4-p2, the code $address->getCartFixedRules() returns an array

[
     "ruleid" => 0.00
]

even there is no discount applied to shipping. And it causes double discount error in Bolt plugin.

Solution: validate the discount amount before calculation.

Fixes: https://app.asana.com/0/1200879031426307/1202082673763428/f

#changelog Bugfix: Discount amount getting doubled

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please validate that you have tested your change in at least one of the following areas:

  • Successfully tested locally (or docker image)
  • Successfully tested on a staging or sandbox server
  • Successfully tested on a merchant's staging server

For PR Reviewer

  • Reviewed unit tests to make sure we are using real components rather than mocks as much as possible?
  • For any major change (observer, new Bolt feature, core Magento interaction) we must add a feature switch, did you verify this?

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • New and existing unit tests pass locally with my changes.
  • I have created or modified unit tests to sufficiently cover my changes.
  • I have added my Jira ticket link and provided a changelog message.

@dumega dumega requested a review from a team as a code owner April 10, 2022 02:25
Copy link
Contributor

@mikeshutov mikeshutov left a comment

Choose a reason for hiding this comment

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

LGTM

@dumega dumega merged commit c90d182 into master Apr 12, 2022
@dumega dumega deleted the ning-discount-whole-cart-243 branch April 12, 2022 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants