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

Discount(s) ignored in Subtotal condition of Free Shipping Cart Rule #35168

Closed
Rickertje opened this issue Mar 6, 2022 · 20 comments
Closed

Discount(s) ignored in Subtotal condition of Free Shipping Cart Rule #35168

Rickertje opened this issue Mar 6, 2022 · 20 comments
Assignees
Labels
Area: Shipping Component: Shipping Issue: needs update Additional information is require, waiting for response Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.0 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

@Rickertje
Copy link

Rickertje commented Mar 6, 2022

Preconditions (*)

  1. M2.4 develop

Steps to reproduce (*)

  1. Clean install
  2. Deactivate Flat rate shipping method
  3. Activate Free shipping for minimum amount of 99999999
  4. Remove alle cart rules. Create 2 new cart rules:
    a) TEST with coupon code TEST, no conditions, discount 100 for the whole cart, discard subsequent rules = No
    b) FREE SHIPPING no coupon code, condition: subtotal excl VAT > $820, free shipping for shipment with matching items, discard subsequent rules = No
  1. Add products to cart for total amount of just a little over $820 > Check the shipping costs
  2. Enter promo code TEST > Again check the shipping costs

Expected result (*)

Free shipping should NOT be applied after entering the promo TEST

Actual result (*)

Free shipping is still applied.

Observations:

  • It's not clear from the dev docs if Cart Rule conditions Subtotal and Subtotal ex VAT should include discounts

Knipselx
Knipsel5

Severity S1/S2

@m2-assistant
Copy link

m2-assistant bot commented Mar 6, 2022

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

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

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.


⚠️ According to the Magento Contribution requirements, all issues 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 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.

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

@m2-community-project m2-community-project bot added this to Ready for Confirmation in Issue Confirmation and Triage Board Mar 6, 2022
@Rickertje Rickertje changed the title Discount(s) ignored in Subtotal condition of Free Shipping Cart Rule or Free Shipping Delvery method Discount(s) ignored in Subtotal condition of Free Shipping Cart Rule or Free Shipping Delivery method Mar 6, 2022
@engcom-November engcom-November self-assigned this Mar 7, 2022
@m2-assistant
Copy link

m2-assistant bot commented Mar 7, 2022

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

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

@Rickertje
Copy link
Author

Rickertje commented Mar 7, 2022

I just tried this (case A) on 2.2.10 and it seemed to have worked correctly back then

@Rickertje
Copy link
Author

I'm no Magento programmer but I think it has something to do with not setting $address->setBaseSubtotalWithDiscount in the collect functions of SalesRule\Model\Quote\Discount.php and/or SalesRule\Model\Quote\Address\Total\ShippingDiscount.php.

@engcom-November
Copy link

Verified the issue on Magento 2.4-develop branch but cannot able to reproduce the issue in both the cases: A and B.
In both the cases A and B Shipping Method is not getting applied - No issue
image
image
@Rickertje , kindly recheck the issue on Magento 2.4-develop branch and provide missing steps if any if the issue is still reproducible.
Thank you.

@engcom-November engcom-November added Issue: needs update Additional information is require, waiting for response Reported on 2.4.0 Indicates original Magento version for the Issue report. labels Mar 8, 2022
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Mar 8, 2022
@engcom-November engcom-November added the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label Mar 8, 2022
@Rickertje
Copy link
Author

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

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

@magento-deployment-service
Copy link

@Rickertje
Copy link
Author

Hi @engcom-November. I tried develop. Things seemed to have changed since 2.4.0. In your test of case A at least a tablerate shipping methode for 811,88 should be applied. Agree? So why was it not applied?
Because of the changes since 2.4.0 the testcases like I originally described do not produce the problem in develop. But the problem is still here. I will change the problem description and then hopefully you can have another look. I will let you know when finished.

@Rickertje Rickertje changed the title Discount(s) ignored in Subtotal condition of Free Shipping Cart Rule or Free Shipping Delivery method Discount(s) ignored in Subtotal condition of Free Shipping Cart Rule Mar 8, 2022
@Rickertje
Copy link
Author

@engcom-November: I changed the steps to reproduce the problem on develop. Can you take another look please?

@engcom-November
Copy link

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

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

@magento-deployment-service
Copy link

@engcom-November
Copy link

Hi @Rickertje Thank you for updating the description. Verified the issue again on Magento 2.4-develop branch and the issue is reproducible. Hence confirming the issue.
image

@engcom-November engcom-November added Area: Shipping Component: Shipping Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch labels Mar 9, 2022
@m2-community-project m2-community-project bot removed the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label Mar 9, 2022
@engcom-November engcom-November added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Mar 9, 2022
@m2-community-project m2-community-project bot moved this from Needs Update to Confirmed in Issue Confirmation and Triage Board Mar 9, 2022
@engcom-November engcom-November added Triage: Need PO Confirmation Requirements should be clarified/approved/confirmed with Product Manager. Not ready for fix/delivery Issue: On Hold and removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Apr 13, 2022
@m2-community-project m2-community-project bot moved this from Ready for Development to Pull Request In Progress in High Priority Backlog Jun 29, 2022
@engcom-November
Copy link

Hi @Rickertje ,
We verified the issue again on Magento 2.4-develop branch and this behavior is concluded as an expected behavior but not a bug after internal discussions.
Reason: Discount is applied on Grand total but the condition to apply Free shipping is based on Product Subtotal amount. Since the product subtotal amount is greater than $820 Free shipping will be applied based on the condition set (subtotal excl VAT > $820) hence this is considered as an expected behavior but not a bug. Kindly recheck the issue on 2.4-develop and let us know if you are still facing any issues.
Thank you.

@engcom-November engcom-November added Issue: needs update Additional information is require, waiting for response and removed Triage: Need PO Confirmation Requirements should be clarified/approved/confirmed with Product Manager. Not ready for fix/delivery Issue: On Hold labels Jul 6, 2022
@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Ready for Development in High Priority Backlog Jul 6, 2022
@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Ready for Development in High Priority Backlog Jul 6, 2022
@engcom-November engcom-November self-assigned this Jul 6, 2022
@m2-community-project m2-community-project bot moved this from Ready for Development to Dev In Progress in High Priority Backlog Jul 6, 2022
@engcom-November engcom-November removed this from Dev In Progress in High Priority Backlog Jul 6, 2022
@Rickertje
Copy link
Author

Like I stated in the problem discription: It is (and has never been) clear from the dev docs if Cart Rule conditions 'Subtotal' and/or 'Subtotal ex VAT' include discounts yes or no => But up until M2.3.x the condition 'Subtotal ex VAT' did indeed take discounts into account.
I would like to add that in general merchants definitely have a need for a mechanism or rule that takes discounts into account when arranging free shipping in Magento. In our case discounts professional clients receive can get up to 35% but in that case we would certainly like them to pay the shipping costs.
So if you decide now that not taking discounts into account is expected behaviour you will remove very usuable functionality that was available in 2.3.x (not sure until which version) and can not be arranged in another way. At least I would like to see you restore this functionality in another way.

@engcom-November
Copy link

engcom-November commented Jul 7, 2022

Hi @Rickertje ,
Thanks for your response.
Its mentioned in Magento docs that, "In a case of multiple parallel promotions/rules, the Subtotal condition is applied to the base shopping cart subtotal amount before any discounts. "
Also, rule: "Fixed amount discount for whole cart" option is used to apply discount on whole cart only. (Subtracts fixed amount from cart total). On the other hand, "Fixed amount discount" discounts item by subtracting a fixed amount from the original price of each qualifying item in the cart
If this has to be changed then it can be considered as feature request but not a bug as its an existing behavior. Kindly check the ref guides and provide your inputs on this.
Thank you.

@engcom-November
Copy link

Hi @Rickertje ,
We are closing this issue as there has been no latest update on the same. Kindly reopen / create new issue if you are still facing any issues.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Shipping Component: Shipping Issue: needs update Additional information is require, waiting for response Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: done Reported on 2.4.0 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Development

No branches or pull requests

4 participants