nozzlegear / ShopifySharp

ShopifySharp is a .NET library that helps developers easily authenticate with and manage Shopify stores.
https://nozzlegear.com/shopify-development-handbook
MIT License
758 stars 312 forks source link

Asset Service: Missing theme id property #404

Open zeppaman opened 5 years ago

zeppaman commented 5 years ago

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

nozzlegear commented 5 years ago

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.

zeppaman commented 5 years ago

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.