WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey guys! How can I make the delivery address to load correctly after setting the cart address?
After changing the delivery address and going to the checkout page, the shipping options load correctly, and if I go back to the cart page it loads the delivery groups correctly too. But if I try to update the delivery address again inside the cart page, it cleans up the delivery groups options.
This is the action that I'm calling to set the delivery address:
case CartForm.ACTIONS.DeliveryAddressesAdd:
if (!cep) break;
// API to get full address from ZipCode
const res = await fetch(`https://viacep.com.br/ws/${cep}/json/`);
const json = (await res.json()) as ViaCepResponse;
// Adding the address
result = await cart.addDeliveryAddresses([
{
selected: true,
address: {
deliveryAddress: {
city: json.localidade,
countryCode: 'BR',
provinceCode: json.estado,
zip: cep as string,
address1: json.logradouro,
address2: json.complemento,
},
},
},
]);
break;
It doesnt work logged in, logged out either.
If someone provide an example, would be great.
Thank you!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hey guys! How can I make the delivery address to load correctly after setting the cart address?
After changing the delivery address and going to the checkout page, the shipping options load correctly, and if I go back to the cart page it loads the delivery groups correctly too. But if I try to update the delivery address again inside the cart page, it cleans up the delivery groups options.
This is the action that I'm calling to set the delivery address:
It doesnt work logged in, logged out either.
If someone provide an example, would be great.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions