Hi all
I followed this link here Updating to 2024-10 to create a Shopify App.
But I’m getting the issue api.applyShippingAddressChange is undefined
https://prnt.sc/LGl-UQ6qn2qe
https://prnt.sc/gY0uoRL_eUY2
Does anyone know reason? What’s the fix? Does Shopify deprecated this function?
Below is my code:
import {
extension,
Banner,
Button,
} from '@shopify/ui-extensions/checkout';
export default extension(
'purchase.checkout.block.render',
(root, api) => {
if (
api.instructions.current.delivery
.canSelectCustomAddress
) {
root.appendChild(
root.createComponent(
Button,
{
onPress: () =>
api.applyShippingAddressChange({
type: 'updateShippingAddress',
address: {
zip: '90201',
},
}),
},
'Change your postal code',
),
);
} else {
root.appendChild(
root.createComponent(
Banner,
{},
'Shipping address cannot be modified',
),
);
}
},
);