What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Disable App Blocks when user stops the subscription

Solved

Disable App Blocks when user stops the subscription

ertanb
Shopify Partner
13 0 2

Hi,

 

I am creating a Shopify App that contains an extension for Online Store. So users who will install my app, will have access to a Block/Section that they will be able to use throughout their website.

 

As i plan to make it Subscription Based, is it any way that i can disable that Block/Section in users website as soon as they stop the subscription?

Accepted Solution (1)
SBD_
Shopify Staff
1831 273 421

This is an accepted solution.

Hey @ertanb 

 

> The recommended approach is to use the available_if condition using an app metafield to control visibility https://shopify.dev/docs/apps/online-store/theme-app-extensions/extensions-framework#conditional-app...

Scott | Developer Advocate @ Shopify 

View solution in original post

Replies 6 (6)

SBD_
Shopify Staff
1831 273 421

Hey @ertanb 

 

Checking with the extensions team - will report back.

Scott | Developer Advocate @ Shopify 

SBD_
Shopify Staff
1831 273 421

This is an accepted solution.

Hey @ertanb 

 

> The recommended approach is to use the available_if condition using an app metafield to control visibility https://shopify.dev/docs/apps/online-store/theme-app-extensions/extensions-framework#conditional-app...

Scott | Developer Advocate @ Shopify 

ertanb
Shopify Partner
13 0 2

Hi @SBD_ ,

 

Great! Thank you for your answer! I think that should make it work. 🙂 

 

I suppose this is the link on how to add a metafield for an app? https://shopify.dev/docs/apps/custom-data/metafields/app-data

bootsgridDev
Shopify Partner
30 1 3

Hi @SBD_ 

 

using "available_if" attribute, which is working only in theme app extension. How can I execute this in my checkout ui extensions.

 

Example:   I want to enable my custom checkout field extensions(checkbox, textfield, select option components) only to my active subscribed users. Please explain how to do that.? I have stored my subscription status in  one metafield, how can I use it to enable or disable my checkout ui extensions in theme editor.

raphaellima
Shopify Partner
47 10 9

Same issue here, any solution about that?

Raphael Lima | Developer
WhatsApp: +55 (31) 92002-9324
bootsgridDev
Shopify Partner
30 1 3

Hi @raphaellima 

 

Only Theme Extension, we can use ""available_if" attribute to hide the extension from the theme customizer, For all other type of  extensions we can only customize/Hide the functionality according to the subscription status, We cannot hide the extension from the theme customizer for now.