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.
We can create line items not only for orders, but hook_commerce_shipping_method_collect_rates() executes on every shipping rates collect event. I've provided additional checks for commerce_discount's implementation
Comment | File | Size | Author |
---|---|---|---|
#1 | 2448751-commerce-discount-shipping-rates-collect-fix.patch | 753 bytes | id.tarzanych |
Comments
Comment #1
id.tarzanych CreditAttribution: id.tarzanych commentedComment #2
joelpittetIs there a case when this is false and the $order is not just empty itself?
Comment #3
id.tarzanych CreditAttribution: id.tarzanych commented@joelpittet
Exactly. Commerce RMA module sends $order object without any parameters except one or two fields data
Comment #4
joelpittet@id.tarzanych can RMA just pass the $order along with it?
Comment #5
id.tarzanych CreditAttribution: id.tarzanych commented@joelpittet
Well, it should do that.
But seems that we should wait till Commerce RMA developers change their code to make it compatible with Commerce Coupon 2.x/Commerce Discount or provide additional checks as I did in this patch.
Drupal 8 doesn't have such problem because we can easily check what Entity type object belongs to
Comment #6
joelpittetMoving over to Commerce Return Merchandise Authorization to deal with #4