Closed hasithaarimac closed 3 years ago
Hello,
first of all your steps are all correct and this the correct way to address the order and get shipping information by province. However it looks like you are missing the provinceCode
property (this is actually a missing feature in the documentation). If you set the provinceCode
instead of the provinceName
in your address, it will validate if the province exists and set name and code on the order.
About your second question: If I understand it right you are looking for an endpoint that takes any address and returns a list of shipping methods. This is not part of the standard shopapi. But using the ShippingMethodResolver
like here:
https://github.com/Sylius/ShopApiPlugin/blob/8fe5f49cb1c3015922fff2c362cb0d03782f3373/src/Controller/Checkout/ShowAvailableShippingMethodsAction.php#L79
you can display shipping methods for any address. You just need to create a seperate endpoint.
Thank you @mamazu for the response. I'll update the province code. Thanks for the valuable inputs. Cheers
Hi,
I have a little problem to clarify from you guys. In my scenario, I need to set multiple shipping methods with multiple Provinces (Which have a single parent country).
Please look at the below steps:
Below scenarios simulated using sylius shop-apis,
Unfortunately, I'm not getting any shipping methods for the above address. ("/shop-api/checkout/{{cart}}/shipping"). But If created a shipping method using the Germany zone, then I'm getting created shipping methods. Is there any way to simulate this process? I need to define shipping methods for multiple areas of a single country. And also I need to get matching shipping methods after we addressing the cart. Is there any way to get these shipping methods using the province, city, zone, or postcode of the given address instead of the country code?
County added :
Provinces added :
Shipping method added :
Addressed the cart :
Get available shipping methods :