How to limit app block and app embed block to specific product pages?

How to limit app block and app embed block to specific product pages?

hacun3jr
Shopify Partner
23 2 19

Hello,

 

I am working with theme app extension. I have an app block and an app embed block, and I want to give users the ability to limit the visibility of these blocks to specific product pages and collections if they want.

 

Looking through the docs, I notice that thereis an enabled_on option and an available_if option using app metafields, but I dont understand the logic with those on how to limit the blocks to specific product or collection pages.

 

I can see how they could be limited based on billing plan or subscription, but how or where to add the logic to check if the product page is a specific one that shouldnt show the app blocks? Thank you.

Reply 1 (1)

Shay
Shopify Staff (Retired)
3110 472 658

Hey @hacun3jr 

 

I am not a developer myself, but I wanted to share a suggestion from a support perspective. Merchants have the ability to control their own templates for products and pages on their store. If this is an embed block that can be enabled/disabled from within the theme editor then the merchant can create a separate template for the products they want this app block to appear on. Once the alternate template is created they can then apply it to the specific products. 

 

You can read more on Templates here: Shopify Help Center | Templates. I hope this information helps!

Shay | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog