Quantcast
Channel: Opinion: Shopify Community - Shopify APIs & SDKs
Viewing all articles
Browse latest Browse all 25503

Jyrgalbek Sh. commented on Unauthorized to Themes

$
0
0

Hello Amit,

 Before adding snippets you have to check theme role, if it is the theme that is used by store by default then its role is main, themes which have role demo does not allow anyone to change or add snippets and assets, also it can not be main theme. So if you want to install it without errors, you have to check theme role, if it is 'demo', then just type continue, here is the php code:

$themes = self::getThemes($api); // just get themes api call
    foreach($themes as $theme)
    {

      if ($theme['role'] == 'demo') continue;

      //create snippet/asset code

    }

 


Viewing all articles
Browse latest Browse all 25503

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>