Closed cka29 closed 6 months ago
Hi @cka29, thanks for the report
Could you confirm that you're opening the checkout URL in a browser with no pre-existing cookies, (e.g. in incognito mode). And also whether you're submitting a customerAccessToken
, as well as the deliveryAddressPreferences
in the mutation's CartBuyerIdentityInput
?
Thanks
Hi @cka29, thanks for the report
Could you confirm that you're opening the checkout URL in a browser with no pre-existing cookies, (e.g. in incognito mode). And also whether you're submitting a
customerAccessToken
, as well as thedeliveryAddressPreferences
in the mutation'sCartBuyerIdentityInput
?Thanks
Thanks for the quick response! Yes I can confirm all those. Better: When I create the cart by mentioned mutation, I even see the deliveryAddressPreferences
in the mutations response. So I know that they're there, but they're just not shown in the mobile apps checkout sheet (only one of them is shown). On the other hand ALL deliveryAddressPreferences
are visible in the desktop browser when calling the checkoutUrl
from my mutations response. Do you need any other infos?
Any news on this one?
Hi @cka29 we're now displaying multiple shipping addresses based on delivery address preferences.
Let us know if you run into any issues.
@kiftio thank you! So this will be included in the next release of CSK? Or was it fixed in Storefront API?
It was Storefront API/checkout side, so no CSK update should be necessary
@kiftio is this already included in the Storefront API v.unstable
? Because it's still not working for me :(
It is in unstable now yes. This video is of the Android sample app on the main
branch, pointing at a test store:
The deliveryAddressPreferences
values are defined in DemoBuyerIdentity.kt
. We don't have multiple addresses in the swift sample yet, but I just tried it out manually and it seemed to work OK there too.
Does the sample app match up with your setup?
N.B. There's also some address validation that happens, where invalid addresses may be discarded
It is in unstable now yes. This video is of the Android sample app on the
main
branch, pointing at a test store:multi-address.mp4 The
deliveryAddressPreferences
values are defined inDemoBuyerIdentity.kt
. We don't have multiple addresses in the swift sample yet, but I just tried it out manually and it seemed to work OK there too.Does the sample app match up with your setup?
N.B. There's also some address validation that happens, where invalid addresses may be discarded
Thanks for the quick response! I will look into it, but the hint regarding address validation could already solve this. Will check.
Thanks! 💯
It is in unstable now yes. This video is of the Android sample app on the
main
branch, pointing at a test store:multi-address.mp4 The
deliveryAddressPreferences
values are defined inDemoBuyerIdentity.kt
. We don't have multiple addresses in the swift sample yet, but I just tried it out manually and it seemed to work OK there too.Does the sample app match up with your setup?
N.B. There's also some address validation that happens, where invalid addresses may be discarded
I checked the code in main
and everything seems to be setup similarly. However if I use createCart
and the according deliveryAddressPreferences
as input for buyerIdentity
I always get an internal server error from Storefront API (version unstable
). I use real addresses with country code DE
for Germany. The store I'm testing against is located in Germany and delivers there too. However I saw that in the demo app you are using a list of MailingAddressInput
instead of customerAddressId
. I have also tried using customerAddressId
, but this did not work either.
EDIT: When I try to use both fields I get this error:
GraphQLError(message: DeliveryAddressInput requires exactly one of delivery_address, customer_address_id, locations: [], path: [cartCreate], extensions: {code: INVALID_FIELD_ARGUMENTS})
Reference: https://shopify.dev/docs/api/storefront/2024-01/input-objects/DeliveryAddressInput
Does it help if I provide you the request-id?
error: GraphQLError(message: Internal error. Looks like something went wrong on our end.
Request ID: ff4df148-b0c9-4f6b-9f68-d0ca4d8d5c5a-1712768921 (include this in support requests)., locations: null, path: null, extensions: {code: INTERNAL_SERVER_ERROR, requestId: ff4df148-b0c9-4f6b-9f68-d0ca4d8d5c5a-1712768921})
Thank you for your patience @kiftio !
Hi @cka29,
Thanks for the request ID, that did help track it down. I found that there's an open issue around this. The error appears when deliveryAddressPreferences
is included in the graphQL response, when MailingAddresses are saved on the cart (as opposed to customerAddressIds).
We're not including deliveryAddressPreferences
in the cartCreate
response in the sample app, so we aren't running into it there.
Some additional notes:
N.B. this all assumes you're not passing in a customerAccessToken
, which changes things a bit but I believe should also lead to multiple addresses being shown (taken from the customer account).
Last note, customer authentication is being worked on, which should be the better long term option. We'll let you know when it's ready.
When creating a cart using the
cartCreate
mutation and providing multipledeliveryAddressPreferences
for theCartBuyerIdentityInput
I can only see one address in the checkout sheet. When I copy the carts'checkoutUrl
and paste it in my browser I can see multiple (those I've sent with the mutation) addresses in the dropdown.Thank you in advance!
EDIT: Same issue on android side, but I haven't opened an issue there yet. Let's check if this is really a bug first :)