Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | 3258290-2.patch | 648 bytes | danmer |
| |||
Screenshot 2022-01-12 at 17.26.57.png | 117.34 KB | danmer |
Comments
Comment #2
danmer CreditAttribution: danmer at Lemberg Solutions, Centarro commentedHere is the patch
Comment #3
jsacksick CreditAttribution: jsacksick at Centarro commentedCommitted!