Skip to content

[BACKPORT 2.2] [BUGFIX] Add FreeShipping to the Items when SalesRule uses FREE_SHIPP… #15013

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

Closed

Conversation

lewisvoncken
Copy link
Contributor

reopen #11916

…ING_ADDRESS

same as magento-partners/magento2ce#59

Description

When you create a Shopping Cart Price Rule for Free Shipping for shipment with matching items.

Fixed Issues (if relevant)

  1. Free shipping coupon not working with Table Rates shipping - Sorry, no quotes are available for this order. #8172: Free shipping coupon not working with Table Rates shipping - Sorry, no quotes are available for this order.
  2. Cart Price Rules based on Shipping Method can't be applied in basket #8089: Cart Price Rules based on Shipping Method can't be applied in basket
  3. Free shipping not being properly applied in CE 2.1.8 #10507: Free shipping coupon not working with Table Rates shipping - Sorry, no quotes are available for this order.

In issue #8172 there is referenced to the shipping method Table Rates but the issue is for all Offline ShippingMethods

Manual testing scenarios

  1. Create a Shopping Cart Price Rule with the following Options based on issue Free shipping coupon not working with Table Rates shipping - Sorry, no quotes are available for this order. #8172
  • Coupon Code: FREESHIP
  • Enabled from/To: 01/01/2016 - 01/01/2022
  • Apply: Percent of product price discount
  • Discount Amount: 0
  • Discard subsequent rules: YES
  • Apply to Shipping Amount: YES
  • Free Shipping: For Shipment with matching items
  1. Add a product to your shopping cart
  2. Apply the coupon code in your shopping cart
  3. Result is that there is no free shipping calculated

Apply changes and try again and the result will be that there is Free Shipping for the cart.

Before:
image

After:
image

@VladimirZaets
Copy link
Contributor

Hi @lewisvoncken , thanks for contribution. As I see, the previous PR was closed by tests failed reason and currently, the fix is the same and our integration tests are failed again. So, what the reason to reopen PR?

@lewisvoncken
Copy link
Contributor Author

lewisvoncken commented May 5, 2018

@VladimirZaets I am going to also apply the fix for the integration but I could not found the original error of the integration. I will update it as soon as the test is done.

This is what I have also done in #15010

@VladimirZaets
Copy link
Contributor

@lewisvoncken ok, currently, I will set need_update label for this PR. Also, if you want I can help you to configure the environment to runs integration tests locally.

@DanielRuf
Copy link
Contributor

So a unit test assertion has to be changed:


There was 1 failure:
1) Magento\Quote\Model\ShippingMethodManagementTest::testEstimateByAddressWithCartPriceRuleByShipment
Failed asserting that 0.0 matches expected 5.
/home/travis/build/magento/magento2/dev/tests/integration/testsuite/Magento/Quote/Model/ShippingMethodManagementTest.php:122
/home/travis/build/magento/magento2/dev/tests/integration/testsuite/Magento/Quote/Model/ShippingMethodManagementTest

@lewisvoncken
Copy link
Contributor Author

@VladimirZaets the unit test and integration test have been updated

@VladimirZaets
Copy link
Contributor

@lewisvoncken thanks

@VladimirZaets
Copy link
Contributor

Hi @lewisvoncken , we have functional test that was failed with your changes. That is Magento\SalesRule\Test\TestCase\ShoppingCartWithFreeShippingAndFlatRateTest.testRuleWithFreeShippingAndFlatRate with data set "FreeShippingRuleMaintainsFlatRate_0"

Can you look and fix it, please?
If you need some help or guide how to running functional tests locally, please let us know.

@VladimirZaets
Copy link
Contributor

@lewisvoncken, I am closing this PR now due to inactivity.
Please reopen and update if you wish to continue.
Thank you for collaboration

@rahimimo
Copy link

@lewisvoncken I tried applying your fix but I get the same error with the fix through REST API. Have you overcame this bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants