I have a checkout extension that targets pickup. I need to hide the pickup location (circled in green) if someone checks the box in the image (orange text).
I don’t know the best way to achieve this. I am thinking if there was a prop I could pass to my extension for this then I could do this but this is just a stab since I don’t know if one exists.
Guidance appreciated!
Hi - there’s no ability to access the window object or other methods of DOM manipulation with checkout extensions, so hiding this field may not be possible. The new extensibility model is designed to be more secure and reliable, and as such, it restricts certain types of customizations that were possible with checkout.liquid and script tags. Have you looked into Shopify Functions to see if your use case would be supported by them?
I don’t think this would be possible with a checkout extension as you’re trying to hide/ interact with a default checkout element, which is out of scope for checkout extensions (as you can’t select elements and interfere with the DOM). The best bet would be to explore if it’s possible with functions.