Closed jmauzyk closed 4 months ago
@jmauzyk Thanks this has been fixed for the next Commerce 4.x release.
To get the fix early, change your craftcms/commerce
requirement in composer.json to:
"require": {
"craftcms/commerce": "4.x-dev#0d3e98464e66cafe43eda1a22ac4ab4e53008f0a as 4.6.1",
"...": "..."
}
Then run composer update
.
We will update this ticket once the release is out. Thanks.
Commerce 4.6.2 and 5.0.8 are out with that fix. Thanks again!
What happened?
Description
For completed orders that have selected a shipping method provided by a plugin, the
shippingMethodName
is erased from the order record after editing and updating in the control panel. This is because on line 1335 ofcraft\commerce\controllers\OrdersController
it uses the following code to update theshippingMethodName
on the order:Because the shipping methods service only queries those provided by Commerce's shipping engine, it does not find others provided by plugins, and sets the
shippingMethodName
to null.This could be avoided by instead using a method like in line 1882 of
craft\commerce\elements\Order
:Steps to reproduce
shippingMethodName
is correctly saved on the order record.shippingMethodName
is now empty on the order record.Expected behavior
Maintain
shippingMethodName
for plugin shipping methods after order update.Actual behavior
shippingMethodName
is erased after update for plugin shipping methods.Craft CMS version
4.9.5 Pro
Craft Commerce version
4.6.1
PHP version
8.2.19
Operating system and version
Linux 6.6.26-linuxkit
Database type and version
PostgreSQL 14.9
Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.11-60)
Installed plugins and versions
No response