Context:

Calculation of shipping costs based on cart elements.

Problem:

Shipping costs stay calculated even if the cart changed in between.

Proposed solution:

Reset the shipping cost calculation if cart was updated / contains different items. This is done like the default Drupal Commerce rule to reset the cart.

Please add the following rule as default to be installed and enabled by this module to fix this bug:

{ "commerce_shipping_cart_update_delete" : {
"LABEL" : "Delete shipping line items on shopping cart updates",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules", "commerce_shipping", "entity" ],
"ON" : { "commerce_order_update" : [] },
"IF" : [
{ "data_is" : { "data" : [ "commerce-order:status" ], "value" : "cart" } },
{ "NOT data_is" : { "data" : [ "commerce-order-unchanged:status" ], "value" : "cart" } }
],
"DO" : [
{ "commerce_shipping_delete_shipping_line_items" : { "commerce_order" : [ "commerce-order" ] } }
]
}
}

I'm already using this successfully in several live environments.

Comments

Anybody created an issue.