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/magento2#12396: Total Amount cart rule without tax #21288

Merged

Conversation

AleksLi
Copy link
Contributor

@AleksLi AleksLi commented Feb 17, 2019

Added new condition type to give user opportunity to choose the configuration.

Description (*)

I thought about the fix of what should be fixed in here. But I guess it's up to the user what to choose and what conditions to have to apply the rule.
I decided to add new Cart Attribute to Subtotal (Excl. Tax) which is basically one of the totals base_subtotal_with_discount

Fixed Issues (if relevant)

  1. magento/magento2#<12396>: "Total Amount" cart rule without tax

Manual testing scenarios (*)

  1. Go to the Admin Panel. Open Marketing->Cart Price Rules
  2. Add new rule or edit existing one
  3. Under the Condition tab you will be able to see new Configuration Subtotal (Excl. Tax).

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 on Travis CI are green)

 - Added new condition type to give user opportunity to choose the configuration.
@magento-engcom-team
Copy link
Contributor

Hi @AleksLi. 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-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

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

@magento-engcom-team magento-engcom-team added Component: SalesRule Release Line: 2.3 Partner: Vaimo Pull Request is created by partner Vaimo partners-contribution Pull Request is created by Magento Partner labels Feb 17, 2019
@aleron75 aleron75 self-assigned this Feb 18, 2019
@@ -61,6 +61,7 @@ public function __construct(
public function loadAttributeOptions()
{
$attributes = [
'base_subtotal_with_discount' => __('Subtotal (Excl. Tax)'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure that the base_subtotal_with_discount is the Subtotal Excluding Tax?
Its name (and usage in the code) makes me think that it is not.
Maybe I am wrong, can you help me understand?
Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty sure that that's the correct subtotal to apply a coupon. I've taken it from the collect method which is always running. All that data in any case will be in the Quote.

@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team
Copy link
Contributor

@AleksLi thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@AleksLi
Copy link
Contributor Author

AleksLi commented Mar 2, 2019

@magento-engcom-team, @aleron75 . I can't merge the changes, please let me know how to do that, or who is willing to do that.

@aleron75
Copy link
Contributor

aleron75 commented Mar 5, 2019

@magento-engcom-team, @aleron75 . I can't merge the changes, please let me know how to do that, or who is willing to do that.

Hello, you can't merge your own PR, it will be merged by the repo maintainers.
Thanks.

@AleksLi
Copy link
Contributor Author

AleksLi commented Mar 5, 2019

Thanks @aleron75 . Now, I will be aware of that.

@soleksii
Copy link

soleksii commented Mar 7, 2019

✔️ QA Passed

@ghost
Copy link

ghost commented Mar 20, 2019

Hi @AleksLi, 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.

@koenner01
Copy link
Contributor

Why was this ever approved as this was clearly never properly tested...

Both "base_subtotal" and "base_subtotal_with_discount" are ALWAYS excluding tax.
The only difference is with "base_subtotal_with_discount" additional discounts are also in the subtotal.

The only real fix for this problem is adding "base_subtotal_total_incl_tax" as this is correct value.

@ghost
Copy link

ghost commented Sep 9, 2020

@koenner01 unfortunately, only members of the maintainers team are allowed to unassign developers from the pull request

@hostep
Copy link
Contributor

hostep commented Apr 29, 2021

@koenner01: I can see in our preview access to Magento 2.3.7 that it will be fixed there (and was already fixed before in 2.4.2), just FYI. That info was also provided in this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Award: bug fix Component: SalesRule Partner: Vaimo Pull Request is created by partner Vaimo partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants