nystudio107 / instantanalytics

DEPRECATED Instant Analytics brings full Google Analytics support to your Twig templates and automatic Craft Commerce integration with Google Enhanced Ecommerce.
Other
101 stars 4 forks source link

FR: Make Commerce Product Category Field a twig field #4

Closed hongc-cc closed 7 years ago

hongc-cc commented 8 years ago

Most people use category to categorize their products. So maybe allow user to twig to get the values. (e.g. {{ product.category.first() }})

p.s. this plugin is cool.

khalwat commented 8 years ago

Agreed, I plan to add that in

oyvindostmo commented 7 years ago

Hi, I just ran into the same. We use category relations both for Product Category and Product Brand. Would be awesome to have this supported. We have a category structure with for example "Clothing > Mens > Jackets" and "Clothing > Womens > Jackets" so sending in "Jackets" wouldn't be unique. Maybe if we had the twig option we could loop through the category relations and send in the full "Clothing > Mens > Jackets". Or maybe the slug that in this case would be "mens-jackets" and "womens-jackets". We launch today - feeling inspired to do some magic? :)

khalwat commented 7 years ago

This has been implemented by @Tam and is available in the develop branch currently:

https://github.com/nystudio107/instantanalytics/tree/develop