ShopifySharp icon indicating copy to clipboard operation
ShopifySharp copied to clipboard

Asset Service: Missing theme id property

Open zeppaman opened this issue 6 years ago • 2 comments

I see this in the documentation:

Finally, all assets are tied to a specific theme, and you need that theme's id to interact with assets. You can use the ThemeService to get a list of the shop's themes, or the ShopService to get the currently active theme's id.

But into Shop entity got from ShopService there isn't any ThemeId field.

I'm misinterpreting the documentation?

Thank you

zeppaman avatar Oct 17 '19 12:10 zeppaman

It looks like the documentation is incorrect here! I could have sworn there was a way to get the active theme more quickly, but it looks like the only way supported by the Shopify API is to list the store's themes and just find the one that has Role set to "main". I'll get the documentation fixed.

nozzlegear avatar Oct 18 '19 01:10 nozzlegear

Thanks @nozzlegear, for this info. It is exactly the way I found and implement to walkaround this issue. Moreover, I can confirm this is working:

var mainTheme = themes.FirstOrDefault(x => x.Role.Equals("main"));

Thank you so much for sharing this awesome library.

zeppaman avatar Oct 18 '19 06:10 zeppaman