- 🇨🇦Canada xmacinfo Canada
Yes, we need some way to refresh the calculation instead of deleting an order and recreating it. It could be a button available only to a user with a specific role.
In my use case, I created an order and forgot to add the billing information. I placed the order too quickly before checking if everything was fine.
I edited the order to add the correct billing information, but the taxes won't refresh.
- 🇩🇪Germany M_Z
I came across this issue and want to report how you can manually trigger an order refresh if you have an order type with shipping.
On the /admin/commerce/orders/ORDER_ID/shipments tab you can "edit" an existing shipment for your order.
You can active the checkboxes for all shipment items and then click the "Recalculate shipping" button.
Don't forget to click the "Save" button at the bottom.
Afterwards you should see the correct tax values in the order summary on /admin/commerce/orders/ORDER_ID tab.
This workaround-like solution should work for a shop administrator with proper permissions.
(For developers you can use devel_php or a custom module to execute the following code for the $order entity that should be refreshed:
$orderRefresh = \Drupal::service('commerce_order.order_refresh'); $orderRefresh->refresh($order);
But this solution isn't suitable for a typical shop administrator, so I want to share my shipping refresh solution above.)