Resolving Magento Order Creation Errors for Shipments to Puerto Rico

Modified on Tue, 22 Oct at 11:48 AM

Sometimes, when processing orders in Magento for shipments to Puerto Rico, errors can occur due to discrepancies in how Puerto Rico is configured between Magento and the selling channel. Typically, the selling channel may treat Puerto Rico as a country, while Magento considers it a state of the USA. This mismatch can leave the "Country" field in the shipping address empty, causing order creation to fail.


How to Fix This Issue


To resolve the error, you need to add Puerto Rico as a country in Magento. Follow these steps:


1. Run this SQL query to insert Puerto Rico into the list of countries in Magento:

 

   INSERT INTO directory_country VALUES ('PR', 'PR', 'PRI');


2. After running the query, enable Puerto Rico in the Magento settings:

   - Go to Stores > Configuration > General > Country Options > Allowed Countries

   - Select Puerto Rico from the list of allowed countries.




Once these steps are completed, Magento will correctly recognize Puerto Rico in the shipping address, preventing errors during order creation.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article