I have created a custom app and installed the theme UI extension. Now, I want to create a price calculator that displays on the storefront for users. I’m creating a block in the extension to display the calculator, and I want the product price to be shown in the calculator when a user lands on any product page. How can I fetch the product price in the block, and how do I work with product data in the extension folder?
You can use the productVariant query to get product prices and if you have access to the product object in the Liquid template where your extension is embedded, you can pass the price as a global JavaScript variable.