Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when syncing orders without Country Code #19

Closed
brettburwell opened this issue Jun 12, 2020 · 3 comments
Closed

Errors when syncing orders without Country Code #19

brettburwell opened this issue Jun 12, 2020 · 3 comments
Assignees

Comments

@brettburwell
Copy link

Hi y'all. After updating to version 1.3.2 of the plugin we're now seeing errors in the XML feed when syncing orders in ShipStation.

The issue seems to be related to the fact that we're passing orders to ShipStation that don't have any address info associated with them (our client pivoted to a curbside pickup model when COVID hit).

Obviously these curbside pickup orders don't need to be passed to ShipStation to begin with, but as far as I can tell there isn't a way to configure the plugin to send some orders to ShipStation, but not others. If that's possible and I'm missing something, let me know.

Here's the specific error we're seeing (that sounds similar to what's happening in #18):

An error occurred attempting to update orders: Error in XML. Reason: The 'Country' element is invalid - The value '' is invalid according to its datatype 'StringExactly2' - The actual length is less than the MinLength value.

I was able to temporarily get things back up and running by editing line 443 of the services/Xml.php file to be:

return $address->countryId ? $address->getCountry()->iso : 'US';

Obviously not a long term fix, but perhaps there's a way to pass along a default in the ternary operator that doesn't cause the feed to break.

If there's any other info I can pass along that'd be helpful let me know. And thanks in advance!

System Info

  • PHP 7.2.31
  • Craft 3.4.22.1
  • Craft Commerce 2.2.20
  • ShipStation Connect 1.3.2
@johnnynotsolucky johnnynotsolucky self-assigned this Jun 18, 2020
@brettburwell
Copy link
Author

Hi y'all. Just checking in to see if you might have any updates to pass along on this one? Thanks.

@johnnynotsolucky
Copy link
Contributor

Hi @brettburwell ShipStation requires the country code unfortunately.

If you don't need the curbside orders to be synchronized to ShipStation, you can use the store field:

image

Add it to the order fields

image

Set the field in ShipStation Connect settings:

image

After this you can get the correct URL for each store to synchronize orders. You can then configure ShipStation to fetch just the orders from the store which you intend to ship.

To put an order in a particular store set the value of the field in the order:

image

@brettburwell
Copy link
Author

Hi @johnnynotsolucky. Thanks for the detailed followup. That super helpful and much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants