craftcms / shopify

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

Request: Return product name and slug alongside id? #27

Closed riccardolardi closed 1 year ago

riccardolardi commented 2 years ago

Would it be possible to return product name and slug alongside the id?

AugustMiller commented 1 year ago

Hi!

Now that the plugin is under Pixel & Tonic’s wing, we've released version 3.0 which includes a number of fixes.

Craft now synchronizes products into elements, so you get back a fully-featured Product object in the template.

{% set products = craft.shopifyProducts.productType('Gift').all() %}

{% for product in products %}
  {{ product.title }}
  {{ product.slug }} (or {{ product.handle }}, if you want Shopify’s version!)
{% endfor %}