FosterCommerce / shipstation-connect

A plugin for Craft Commerce 2 that integrates with ShipStation.
https://plugins.craftcms.com/shipstationconnect
Other
7 stars 10 forks source link

Unable to get shipstation to update order in craft #21

Closed williamhibberd closed 3 years ago

williamhibberd commented 3 years ago

I am currently struggling to get shipstation to talk back to craft, to add info into the matrix field, and change the order status. My web.log shows the following error:

2020-11-02 05:40:14 [-][1][-][error][fostercommerce\shipstationconnect\controllers\OrdersController::logException] Error processing action shipnotify
2020-11-02 05:40:14 [-][1][-][error][yii\base\ErrorException:1] yii\base\ErrorException: Failed to find Commerce OrderStatus 'Shipped' in /home/forge/xxx.com/vendor/yiisoft/yii2/base/ErrorException.php:43
Stack trace:
#0 /home/forge/xxx.com/vendor/fostercommerce/shipstationconnect/src/controllers/OrdersController.php(64): fostercommerce\shipstationconnect\controllers\OrdersController->postShipment()
#1 [internal function]: fostercommerce\shipstationconnect\controllers\OrdersController->actionProcess(NULL, 'shipnotify')
#2 /home/forge/xxx.com/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /home/forge/xxx.com/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams(Array)
#4 /home/forge/xxx.com/vendor/craftcms/cms/src/web/Controller.php(190): yii\base\Controller->runAction('process', Array)
#5 /home/forge/xxx.com/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('process', Array)
#6 /home/forge/xxx.com/vendor/craftcms/cms/src/web/Application.php(274): yii\base\Module->runAction('shipstationconn...', Array)
#7 /home/forge/xxx.com/vendor/craftcms/cms/src/web/Application.php(577): craft\web\Application->runAction('shipstationconn...', Array)
#8 /home/forge/xxx.com/vendor/craftcms/cms/src/web/Application.php(253): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#9 /home/forge/xxx.com/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#10 /home/forge/xxx.com/web/index.php(22): yii\base\Application->run()
#11 {main}

I don't have a Commerce OrderStatus 'shipped', but have the following setup which matches in Craft and Shipstation:

Screenshot 2020-11-11 at 10 59 00 Screenshot 2020-11-11 at 10 58 47

Finally I have added the matrix field to the Order Fields here https://xxx.com/admin/commerce/settings/ordersettings is this correct? It isn't 100% clear if you need to do this or not.

Thanks

johnnynotsolucky commented 3 years ago

@williamhibberd I have added a configuration item to set the order status field to use for the "shipped" order status:

image

Previously this was hard-coded to "shipped", however the status on your site is "orderShipped" which was causing the error.