Posted on 04/06/2018 14:43:29
Hi Marie,
you can try to use that code(methodId - needs to be your shipping method id):
API for 9.4:
Dim selectedCountries As New Ecommerce.International.CountryCollection()
For Each country As Ecommerce.International.Country In Ecommerce.Services.Countries.GetCountries()
If Ecommerce.International.CountryRelation.GetCoutryRelations(country.Code2, country.RegionCode, methodId, Ecommerce.Orders.Fee.MethodTypeShippment).Any() Then
selectedCountries.Add(country)
End If
Next
API for 9.3:
Dim selectedCountries As New Ecommerce.International.CountryTextCollection()
For Each dwCountryText As Ecommerce.International.CountryText In Ecommerce.International.CountryText.GetCoutryTexts
If dwCountryText.CountryRelations(methodId, Ecommerce.Orders.Fee.MethodTypeShippment).Any() Then
selectedCountries.Add(dwCountryText)
End If
Next
Regards, Dmitrij