Multiple app blocks in theme app extension

Hi dev community,

I would like to know some informations for my shopify app development as there is no information provided in official documentations. I have a developed a theme app extension with an app-embed block to display a dynamic content in the cart page based on the cart details.

Similarly, I want to show another block in the products page. The block will be displayed only to specific products based on some details, which means, when user views a specific product the block will be displayed. For this, I need to get the product details which is being currently viewed by the user. Can someone tell me how to get this product details in the theme app extensions. I’m not using liquid code because I need to display dynamic content based on the storefront details. So I code in js which is kept under assets directory and included in the schema in liquid file.

Hi Narayanan,

You can control the visibility of an app block or app embed block based on a custom condition, see these docs: Theme app extension configuration

@Liam-Shopify You haven’t solved my query and you’re marking it as solved. How can you do instead of being responsible in solving the query. I know how to control the visibility of an app block or app embed block. I just asked how to get currently viewed product details into theme app extension.

And for your information, I got my solution. Thanks for .

My bad Narayanan - I thought the doc explained what you needed. The approach I’d use would be to use the enabled_on attribute to target a specific product template, and then for whichever products meet the conditions, apply that specific product template to those products. There also could be JS based approaches too which you likely found.