-
Notifications
You must be signed in to change notification settings - Fork 7
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
CountryResolver won't resolve country #7
Comments
Hello, Sorry for the late reply. I have verified the method and I confirm that the default connector's method is working as expected since the Or maybe am I missing something? Best, Johann |
I see, so you called In my setup I got the countryLabel parameter as the 2 digit ISO code, for example: BE That is something that caused by magento I think, this call If I remember correctly the magento module 'bpost' was also involved. |
In this case, are you able to create a custom plugin on the |
That's possible yes. `diff --git a/vendor/mirakl/magento2-seller-connector/Sales/Model/Address/CountryResolver.php b/vendor/mirakl/magento2-seller-connector/Sales/Model/Address/CountryResolver.php
@@ -92,4 +96,4 @@ class CountryResolver
-} |
m2: 2.3.6
mirakl module version: 1.3.0
In my opinion this method will always return false.
magento2-seller-connector/Sales/Model/Address/CountryResolver.php
Line 60 in 30a3a8c
It is because the array_search won't find the country code. The countries array contains country_code => country_name pairs.
I needed to add an earlier return with array_key_exists
See screenshot
With this patch country_id will be the same as country in the addresses.
I see also that the validation should be skipped explicitely:
magento2-seller-connector/Sales/Model/Create/Order.php
Line 218 in e2727a9
However, I always get this error: Some addresses can't be used due to the configurations for specific countries.
because the country id was null.
With the above patch it is not null.
The text was updated successfully, but these errors were encountered: