craftcms / shopify

Synchronize and extend product data from your Shopify storefront.
MIT License
44 stars 25 forks source link

Add support for collections #17

Closed TonyDeStefano closed 4 years ago

TonyDeStefano commented 4 years ago

We needed the option to be able to link to a Shopify Collection as well (which contains lists of curated products). This new code adds that functionality. I refactored the Product Field class a bit so that both field types could work with the same twig template (rather than duplicating an entire twig template). This also includes Ryan's work on this PR:

https://github.com/nmaier95/craft-shopify-product-fetcher/pull/13

Here is a screenshot showing both the Product Picker and Collection Picker together:

image

Shopify doesn't have a single endpoint for all collections, so I had to retrieve Smart Collections and Manual Collections separately and then merge them together, which is why you see the prefix in front of each collection name.

Thanks, and let me know if you have any questions. This plugin has been a tremendous help to Funko's CMS. Thank you for building it!

nmaier95 commented 4 years ago

Hi @TonyDeStefano appreciate your feedback!

Im just wondering now if @ryanpcmcquen s request for pr #13 becomes obsolete? Because of this new pr including both his old changes of #13 and your new feature of shopify collections?

ryanpcmcquen commented 4 years ago

@nmaier95, yeah, you can just close #13 if you merge this one, or merge #13 first.