App reviews, troubleshooting, and recommendations
Hi, I am creating an extensibilty checkout extension to change the shipping address.
I am using the function "applyShippingAddressChange" but I always get an error in console that it is not a function.
even though I specify the field I want to change manually, I still get an error.
Solved! Go to the solution
This is an accepted solution.
I have found the solution!! You need to request access to protected customer data:
https://shopify.dev/docs/apps/store/data-protection/protected-customer-data#request-access-to-protec...
I am facing the same issue, I read somewhere it is a scope issue, but I tried a different scope as well. Please update on it if you find a solution.
import {
reactExtension,
Checkbox,
useApplyShippingAddressChange,
} from '@shopify/ui-extensions-react/checkout';
// Choose an extension target
export default reactExtension(
'purchase.checkout.block.render',
() => <Extension />,
);
function Extension() {
const applyShippingAddressChange = useApplyShippingAddressChange();
// Render a UI
return (
<Checkbox onChange={onCheckboxChange}>
Autofill Address
</Checkbox>
);
// Call API methods to modify the checkout
async function onCheckboxChange(isChecked) {
try {
const result = await applyShippingAddressChange({
type: 'updateShippingAddress',
address: { city: 'Maidenhead' }
});
console.log('applyShippingAddressChange result', result);
} catch (error) {
console.error('Error updating phone number:', error);
}
}
}
Hi, any update on this? I’m also facing the same problem!
This is an accepted solution.
I have found the solution!! You need to request access to protected customer data:
https://shopify.dev/docs/apps/store/data-protection/protected-customer-data#request-access-to-protec...
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024