<p>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? <a href="https://github.com/onedesign/oneshipstation/archive/master.zip" rel="nofollow noreferrer">https://github.com/onedesign/oneshipstation/archive/master.zip</a></p>

CC BY-SA 3.0
2017-07-12T11:48:12.127Z
I just downloaded the updated version of the plugin and can confirm that I'm seeing the same error.
Brett Burwell
CC BY-SA 3.0
2017-07-14T16:01:47.257Z
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
CC BY-SA 3.0
2017-07-14T18:57:05.320Z
@P.Stucker Sounds like your server doesn't have the DOM extension installed and the plugin is using it: http://php.net/manual/en/book.dom.php
Brad Bell
CC BY-SA 3.0
2017-07-17T12:57:40.987Z
It may sound like that, but when I go to my i.php, DOM shows as listed. Thoughts?
P. Stucker
CC BY-SA 3.0
2017-07-11T18:26:55.553Z
2017-07-11T18:26:55.553Z
Noah Bernsohn
<p>I'm currently looking to implement the One ShipStation plugin for my Craft Commerce site.</p>

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

<p>Shipstation requires a XML page to work, and the One Shipstation provides the URL "<a href="https://www.mywebsite.com/actions/oneShipStation/orders/process" rel="nofollow noreferrer">https://www.mywebsite.com/actions/oneShipStation/orders/process</a>"</p>

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

<p><strong>UPDATE:</strong></p>

<p>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.</p>

<p>First I changed</p>

<pre><code>location / {
        try_files $uri $uri/ /index.php?$args;
    }
</code></pre>

<p>to</p>

<pre><code>location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
</code></pre>

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

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

<pre><code>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-&gt;valueFromMappingAndModel()
#1 /var/www/mywebsite.com/craft/plugins/oneshipstation/services/OneShipStation_XmlService.php(117): Craft\OneShipStation_XmlService-&gt;mapCraftModel()
#2 /var/www/mywebsite.com/craft/plugins/oneshipstation/services/OneShipStation_XmlService.php(91): Craft\OneShipStation_XmlService-&gt;item()
#3 /var/www/mywebsite.com/craft/plugins/oneshipstation/services/OneShipStation_XmlService.php(66): Craft\OneShipStation_XmlService-&gt;items()
#4 /var/www/mywebsite.com/craft/plugins/oneshipstation/services/OneShipStation_XmlService.php(22): Craft\OneShipStation_XmlService-&gt;order()
#5 /var/www/mywebsite.com/craft/plugins/oneshipstation/controllers/OneShipStation_OrdersController.php(65): Craft\OneShipStation_XmlService-&gt;orders()
#6 /var/www/mywebsite.com/craft/plugins/oneshipstation/controllers/OneShipStation_OrdersController.php(22): Craft\Oneshipstation_OrdersController-&gt;getOrders()
#7 unknown(0): Craft\Oneshipstation_OrdersController-&gt;actionProcess()
#8 /var/www/mywebsite.com/craft/app/framework/web/actions/CAction.php(109): ReflectionMethod-&gt;invokeArgs()
#9 /var/www/mywebsite.com/craft/app/framework/web/actions/CInlineAction.php(47): CInlineAction-&gt;runWithParamsInternal()
#10 /var/www/mywebsite.com/craft/app/framework/web/CController.php(308): CInlineAction-&gt;runWithParams()
#11 /var/www/mywebsite.com/craft/app/framework/web/CController.php(286): Craft\Oneshipstation_OrdersController-&gt;runAction()
#12 /var/www/mywebsite.com/craft/app/framework/web/CController.php(265): Craft\Oneshipstation_OrdersController-&gt;runActionWithFilters()
#13 /var/www/mywebsite.com/craft/app/framework/web/CWebApplication.php(282): Craft\Oneshipstation_OrdersController-&gt;run()
#14 /var/www/mywebsite.com/craft/app/etc/web/WebApp.php(817): Craft\WebApp-&gt;runController()
#15 /var/www/mywebsite.com/craft/app/etc/web/WebApp.php(287): Craft\WebApp-&gt;_processActionRequest()
#16 /var/www/mywebsite.com/craft/app/framework/base/CApplication.php(185): Craft\WebApp-&gt;processRequest()
#17 /var/www/mywebsite.com/craft/app/index.php(62): Craft\WebApp-&gt;run()
#18 /var/www/mywebsite.com/public/index.php(19): require_once()
REQUEST_URI=/actions/oneShipStation/orders/process?SS-UserName=username&amp;SS-Password=p@$$w0rd&amp;action=export&amp;start_date=07%2f11%2f2017+15%3a16&amp;end_date=07%2f11%2f2017+15%3a21&amp;page=1
</code></pre>

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

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

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

        $item_xml-&gt;addChild('WeightUnits', 'Grams');

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

        return $item_xml;
    }
</code></pre>

<p>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.</p>

<p><strong>UPDATE 14-07-17:</strong></p>

<p>The 500 error I now receive is the following.</p>

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

CC BY-SA 3.0
2017-07-11T01:20:10.520Z
Only thing I can answer is the last "is action a protected parameter now?" and the answer is no. :)  There is an actionTrigger config setting that is set to "actions" by default: https://craftcms.com/docs/config-settings#actionTrigger
Brad Bell
<plugins><url><shipping>
One ShipStation Plugin - 404 Error - UPDATED 14-07-17
# One ShipStation Plugin - 404 Error - UPDATED 14-07-17

(Asked by: username_0 on 2017-07-10)

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.
UPDATE:
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;
    }

to
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()
REQUEST_URI=/actions/oneShipStation/orders/process?SS-UserName=username&SS-Password=p@$$w0rd&action=export&start_date=07%2f11%2f2017+15%3a16&end_date=07%2f11%2f2017+15%3a21&page=1

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

**Tags:** plugins, url, shipping
> **Comments:**
> **username_1**: Only thing I can answer is the last "is action a protected parameter now?" and the answer is no. :)  There is an actionTrigger config setting that is set to "actions" by default: https://craftcms.com/docs/config-settings#actionTrigger  

---

## 1 answers

### Answer by username_2 on 2017-07-11. Score: 1

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>

> **Comments:**
> **username_3**: I just downloaded the updated version of the plugin and can confirm that I'm seeing the same error.  
> **username_0**: 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"  
> **username_1**: @P.Stucker Sounds like your server doesn't have the DOM extension installed and the plugin is using it: http://php.net/manual/en/book.dom.php  
> **username_0**: It may sound like that, but when I go to my i.php, DOM shows as listed. Thoughts?  

---

