I'm currently looking to implement the One ShipStation plugin for my Craft Commerce site.

I went through the Custom store settings on Shipstation.com, making sure they matched the settings in the Plugin settings page.

Shipstation requires a XML page to work, and the One Shipstation provides the URL "https://www.mywebsite.com/actions/oneShipStation/orders/process"

Testing the Connection from Shipstation's side is unsuccessful, and returns a 404 error, saying that the URL cannot be found.


I made a few changes, and no longer receive a 404 error. This change came from changing some of the NGINX configurations for my site.

First I changed

location / {
        try_files $uri $uri/ /index.php?$args;


location / {
        try_files $uri $uri/ /index.php?$query_string;

Then I made sure that all url inquiries were being redirected to https, which cleared up some other issues I was having.

I am now receiving a 500 error, and this is what the log spits out

2017/07/11 15:21:53 [error] [php] Trying to get property of non-object (/var/www/mywebsite.com/craft/plugins/oneshipstation/services/OneShipStation_XmlService.php:108)
Stack trace:
#0 /var/www/mywebsite.com/craft/plugins/oneshipstation/services/OneShipStation_XmlService.php(266): Craft\OneShipStation_XmlService->valueFromMappingAndModel()
#1 /var/www/mywebsite.com/craft/plugins/oneshipstation/services/OneShipStation_XmlService.php(117): Craft\OneShipStation_XmlService->mapCraftModel()
#2 /var/www/mywebsite.com/craft/plugins/oneshipstation/services/OneShipStation_XmlService.php(91): Craft\OneShipStation_XmlService->item()
#3 /var/www/mywebsite.com/craft/plugins/oneshipstation/services/OneShipStation_XmlService.php(66): Craft\OneShipStation_XmlService->items()
#4 /var/www/mywebsite.com/craft/plugins/oneshipstation/services/OneShipStation_XmlService.php(22): Craft\OneShipStation_XmlService->order()
#5 /var/www/mywebsite.com/craft/plugins/oneshipstation/controllers/OneShipStation_OrdersController.php(65): Craft\OneShipStation_XmlService->orders()
#6 /var/www/mywebsite.com/craft/plugins/oneshipstation/controllers/OneShipStation_OrdersController.php(22): Craft\Oneshipstation_OrdersController->getOrders()
#7 unknown(0): Craft\Oneshipstation_OrdersController->actionProcess()
#8 /var/www/mywebsite.com/craft/app/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs()
#9 /var/www/mywebsite.com/craft/app/framework/web/actions/CInlineAction.php(47): CInlineAction->runWithParamsInternal()
#10 /var/www/mywebsite.com/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams()
#11 /var/www/mywebsite.com/craft/app/framework/web/CController.php(286): Craft\Oneshipstation_OrdersController->runAction()
#12 /var/www/mywebsite.com/craft/app/framework/web/CController.php(265): Craft\Oneshipstation_OrdersController->runActionWithFilters()
#13 /var/www/mywebsite.com/craft/app/framework/web/CWebApplication.php(282): Craft\Oneshipstation_OrdersController->run()
#14 /var/www/mywebsite.com/craft/app/etc/web/WebApp.php(817): Craft\WebApp->runController()
#15 /var/www/mywebsite.com/craft/app/etc/web/WebApp.php(287): Craft\WebApp->_processActionRequest()
#16 /var/www/mywebsite.com/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest()
#17 /var/www/mywebsite.com/craft/app/index.php(62): Craft\WebApp->run()
#18 /var/www/mywebsite.com/public/index.php(19): require_once()

Which points to this portion of the plugin's services, specifically the line that starts "$item_mapping = ..."

public function item(\SimpleXMLElement $xml, Commerce_LineItemModel $item, $name='Item') {
        $item_xml = $xml->getName() == $name ? $xml : $xml->addChild($name);

        $item_mapping = ['SKU'              => ['callback' => function($item) { return $item->getPurchasable()->sku; }],
                         'Name'             => 'description',
                         'Weight'           => ['callback' => function($item) { return round($item->weight, 2); },
                                                'cdata' => false],
                         'Quantity'         => ['field' => 'qty',
                                                'cdata' => false],
                         'UnitPrice'        => ['callback' => function($item) { return round($item->salePrice, 2); },
                                                'cdata' => false]
        $this->mapCraftModel($item_xml, $item_mapping, $item);

        $item_xml->addChild('WeightUnits', 'Grams');

        if (isset($item->snapshot['options'])) {
            $option_xml = $this->options($item_xml, $item->snapshot['options']);

        return $item_xml;

I believe the previous error may have resulted from an incomplete order model, which may have been resolved by a colleague working on another portion of the site.

UPDATE 14-07-17:

The 500 error I now receive is the following.

Call to undefined function Craft\dom_import_simplexml() in /var/www/mywebsite.com/craft/plugins/oneshipstation/services/OneShipStation_XmlService.php:404

It looks like you may be using an out of date version of the plugin. Can you try updating to the latest and see if you're still getting this error? https://github.com/onedesign/oneshipstation/archive/master.zip

  • I just downloaded the updated version of the plugin and can confirm that I'm seeing the same error. Jul 12 '17 at 11:48
  • I too have downloaded the latest version of the plugin, and am running into the current error. "Call to undefined function Craft\dom_import_simplexml() in /var/www/mysite.com/craft/plugins/oneshipstation/services/OneShipStation_XmlService.php:404"
    – P. Stucker
    Jul 14 '17 at 16:01
  • @P.Stucker Sounds like your server doesn't have the DOM extension installed and the plugin is using it: php.net/manual/en/book.dom.php
    – Brad Bell
    Jul 14 '17 at 18:57
  • It may sound like that, but when I go to my i.php, DOM shows as listed. Thoughts?
    – P. Stucker
    Jul 17 '17 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.