Magento2: Free shipping not being properly applied in CE 2.1.8

Created on 12 Aug 2017  路  16Comments  路  Source: magento/magento2

Preconditions

  1. Magento CE 2.1.8 PHP 7.0.22 and 5.6.31
  2. setup a cart price rule giving free shipping to any order over $50. No coupon, unlimited use, all website, all users. Under the "actions" submenu "free shipping" should be set to "For shipment with matching item"

Steps to reproduce

  1. as either guest or registered user add an item costing $50 or greater to cart
  2. proceed to checkout

Expected result

  1. Shipping cost should be zero.

Actual result

  1. shipping rate still apply

Other comments

The free shipping rule will apply if "free shipping" is set to "for matching items only".

The test was performed using the sample data with the sample luma store. Sample data provide a sample cart price giving free shipping for order over $50. "free shipping" is set to "for shipment with matching item" by default for the luma store sample data.

Free shipping using this option, which is the default with the sample data, still works with 2.0.15 and has previously worked for 2.1.7, so it seems like functionality was lost.

Fixed in 2.1.x Clear Description Confirmed Format is valid Ready for Work bug report

Most helpful comment

@PieterCappelle Not really, we use the cweagans/composer-patches to patch any vendor package. (see: https://github.com/cweagans/composer-patches). If you install it then you can add this to your project's composer json:

"extra": {
    "patches-file": "composer.patches.json"
  }

and in the composer.patches.json you can define which patch should apply to which vendor package easily. e.g.:

"magento/module-offline-shipping": {
      "[PATCH] Fix free shipping is not applied with 'For shipment with matching items' option": "patches/fix-free-shipping-is-not-applied-issue.patch"
    }

And this is how we usually create the patch:
howtopatch

At least this is how we do it. I am sure there are other ways to handle patches but so far we found this as the most usable method.

All 16 comments

Same here, Installing 2.1.8 Option to free sending wont work anymore.

Can confirm! 2.1.8.

Found a solution, do not use 'For shipment with matching items' but use 'For matching items only'.

Can also confirm, 2.1.8.

maybe because of an execption:
[2017-08-14 10:41:42] main.CRITICAL: Exception: Warning: iconv_substr() expects parameter 1 to be string, array given in xxxxx/vendor/magento/framework/Stdlib/StringUtils.php on line 183 in xxxxx/vendor/magento/framework/App/ErrorHandler.php:61
Stack trace:

0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'iconv_substr() ...', '/html/domains/w...', 183, Array)

1 xxxxx/vendor/magento/framework/Stdlib/StringUtils.php(183): iconv_substr(Array, 0, 35, 'UTF-8')

2 xxxxx/vendor/magento/module-dhl/Model/Carrier.php(430): Magento\Framework\Stdlib\StringUtils->substr(Array, 0, 35)

Hi @jkf276
This issue as duplicate of #6584

@oleg-onufer The other issue is about the weight

@PieterCappelle

Found a solution, do not use 'For shipment with matching items' but use 'For matching items only'.

Does this reliably work for you? For us it did not work when on the cart page, and sometimes still not in checkout.

Sorry, my mistake - I had a coupon code assigned, works now with your change. Does the workaround have any side effects?

I can reproduce the issue in 2.1.8. But it seems it is fixed in the develop branch.
So I have applied these two commits as patches and that solved the issue:
https://github.com/magento/magento2/commit/a592766b2004a6e9c5d2cfd9dcb54513c7b2212f
https://github.com/magento/magento2/commit/1db9cef7462af6d39ddc5de0dd53f4c9f70cbb23

@tkotosz Is it difficult to patch 2 commits to a composer installation of Magento? Never did that before.

@PieterCappelle Not really, we use the cweagans/composer-patches to patch any vendor package. (see: https://github.com/cweagans/composer-patches). If you install it then you can add this to your project's composer json:

"extra": {
    "patches-file": "composer.patches.json"
  }

and in the composer.patches.json you can define which patch should apply to which vendor package easily. e.g.:

"magento/module-offline-shipping": {
      "[PATCH] Fix free shipping is not applied with 'For shipment with matching items' option": "patches/fix-free-shipping-is-not-applied-issue.patch"
    }

And this is how we usually create the patch:
howtopatch

At least this is how we do it. I am sure there are other ways to handle patches but so far we found this as the most usable method.

@jkf276 thank you for your bug report.
We've created internal ticket MAGETWO-75302 to track progress on the issue.

@jkf276 @magento-engcom-team in my opinion this is the same issue as magento/magento2#8172 which I have solved in the partner github https://github.com/magento-partners/magento2ce/pull/59

I'm working on it #SQUASHTOBERFEST

@PieterCappelle thank you so much, your temporary solution works also for me in magento 2.1.9

The issue has been fixed in 2.1-develop branch. Will be available with next patch release
Fix to 2.2-develop is on the way

Was this page helpful?
0 / 5 - 0 ratings