craftcms / shopify

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

Did nmaier95/shopify-product-fetcher 2.2.0 also have a collection field? #101

Closed AmandaLutzTO closed 2 months ago

AmandaLutzTO commented 3 months ago

Description

I inherited this Craft site and first task is updating to Craft 4. Migrating from nmaier95/shopify-product-fetcher 2.2.0 to craftcms/shopify 4.0.0. Working through the migration steps (https://github.com/craftcms/shopify/tree/v4?tab=readme-ov-file#migrating-from-v2x) but I have 2 missing field types:

Steps to reproduce

  1. Upgrade to Craft 4
  2. Configure Shopify plugin settings
  3. Sync products (success)
  4. Start doc migration steps
  5. Can create new Shopify Products field but missing Collection field type

Additional info

linear[bot] commented 3 months ago

PT-1554 Did nmaier95/shopify-product-fetcher 2.2.0 also have a collection field?

lukeholder commented 2 months ago

The docs explain how to migrate the products field using the resave command.

As for the collections field, until we add collections syncing, you will need to do the same steps as the products and make a text field to store the old collection handle, and then retrieve the collection with the API directly with twig:

{% set req = craft.shopify.api.get('custom_collections') %}
{% set collections = req.response.custom_collections %}

Hope that helps in the interim.