Problem/Motivation

During some development, I have noticed the issue that we have different shipping methods for invoice and order which is created from this invoice, after some debugging I have noticed that on \Drupal\commerce_shipping\EventSubscriber\OrderItemSubscriber::onOrderItemUpdate()
$order_item->getQuantity() returns '1' as a string, but $order_item->original->getQuantity() returns '1.00' as a float, so basically these two are not equal and it force shipping refresh, after that shipping method is changing.

Proposed resolution

Us the Field item equals method instead.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

danmer created an issue. See original summary.

danmer’s picture

Status: Active » Needs review
FileSize
648 bytes

Here is the patch

jsacksick’s picture

Status: Needs review » Fixed

Committed!

  • jsacksick committed 8c71b7c on 8.x-2.x authored by danmer
    Issue #3258290 by danmer, sacksick: Fix the order item quantity...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.