You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-8
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,12 @@ Before upgrading ensure that the **Admin API access scopes** match the [requirem
42
42
43
43
After upgrading, ensure that all required webhooks have been created by clicking the “Create” button on the **Shopify**→**Webhooks** screen in your project’s control panel page in the CP. If the “Create” button is not visible, all required webhooks have been created.
44
44
45
+
#### From `3.x` to `4.x`
46
+
47
+
In version `4.0.0` the plugin changed its Shopify API requirement to version `2023-10`. Any Shopify custom apps created before this version will need to update their webhook event version to `2023-10`.
48
+
49
+
This can be done by visiting your Shopify store and going to **Settings**→**Apps and sales channels**→**Develop apps** clicking you app and then **Configuration**→**Webhook version**.
50
+
45
51
### Create a Shopify App
46
52
47
53
The plugin works with Shopify’s [Custom Apps](https://help.shopify.com/en/manual/apps/custom-apps) system.
Additionally (at the bottom of this screen), the **Webhook subscriptions**→**Event version** should be `2022-10`.
67
+
Additionally (at the bottom of this screen), the **Webhook subscriptions**→**Event version** should be `2023-10`.
62
68
63
69
3.**Admin API access token**: Reveal and copy this value into your `.env` file, as `SHOPIFY_ADMIN_ACCESS_TOKEN`.
64
70
4.**API key and secret key**: Reveal and/or copy the **API key** and **API secret key** into your `.env` under `SHOPIFY_API_KEY` and `SHOPIFY_API_SECRET_KEY`, respectively.
@@ -124,7 +130,7 @@ Once the plugin has been configured, perform an initial synchronization via the
124
130
125
131
### Native Attributes
126
132
127
-
In addition to the standard element attributes like `id`, `title`, and `status`, each Shopify product element contains the following mappings to its canonical [Shopify Product resource](https://shopify.dev/api/admin-rest/2022-10/resources/product#resource-object):
133
+
In addition to the standard element attributes like `id`, `title`, and `status`, each Shopify product element contains the following mappings to its canonical [Shopify Product resource](https://shopify.dev/api/admin-rest/2023-10/resources/product#resource-object):
@@ -137,8 +143,8 @@ In addition to the standard element attributes like `id`, `title`, and `status`,
137
143
|`tags`| Tags associated with the product in Shopify. |`Array`|
138
144
|`templateSuffix`|[Liquid template suffix](https://shopify.dev/themes/architecture/templates#name-structure) used for the product page in Shopify. |`String`|
139
145
|`vendor`| Vendor of the product. |`String`|
140
-
|`metaFields`|[Metafields](https://shopify.dev/api/admin-rest/2022-10/resources/metafield#resource-object) associated with the product. |`Array`|
141
-
|`images`| Images attached to the product in Shopify. The complete [Product Image resources](https://shopify.dev/api/admin-rest/2022-10/resources/product-image#resource-object) are stored in Craft. |`Array`|
146
+
|`metaFields`|[Metafields](https://shopify.dev/api/admin-rest/2023-10/resources/metafield#resource-object) associated with the product. |`Array`|
147
+
|`images`| Images attached to the product in Shopify. The complete [Product Image resources](https://shopify.dev/api/admin-rest/2023-10/resources/product-image#resource-object) are stored in Craft. |`Array`|
142
148
|`options`| Product options, as configured in Shopify. Each option has a `name`, `position`, and an array of `values`. |`Array`|
143
149
|`createdAt`| When the product was created in your Shopify store. |`DateTime`|
144
150
|`publishedAt`| When the product was published in your Shopify store. |`DateTime`|
@@ -147,7 +153,7 @@ In addition to the standard element attributes like `id`, `title`, and `status`,
147
153
All of these properties are available when working with a product element [in your templates](#templating).
148
154
149
155
> **Note**
150
-
> See the Shopify documentation on the [product resource](https://shopify.dev/api/admin-rest/2022-10/resources/product#resource-object) for more information about what kinds of values to expect from these properties.
156
+
> See the Shopify documentation on the [product resource](https://shopify.dev/api/admin-rest/2023-10/resources/product#resource-object) for more information about what kinds of values to expect from these properties.
151
157
152
158
### Methods
153
159
@@ -347,7 +353,7 @@ Filter by the vendor information from Shopify.
347
353
348
354
#### `images`
349
355
350
-
Images are stored as a blob of JSON, and only intended for use in a template in conjunction with a loaded product. Filtering directly by [image resource](https://shopify.dev/api/admin-rest/2022-10/resources/product-image#resource-object) values can be difficult and unpredictable—you may see better results using [the `.search()` param](https://craftcms.com/docs/4.x/searching.html#development).
356
+
Images are stored as a blob of JSON, and only intended for use in a template in conjunction with a loaded product. Filtering directly by [image resource](https://shopify.dev/api/admin-rest/2023-10/resources/product-image#resource-object) values can be difficult and unpredictable—you may see better results using [the `.search()` param](https://craftcms.com/docs/4.x/searching.html#development).
351
357
352
358
```twig
353
359
{# Find products that have an image resource mentioning "stripes": #}
@@ -414,13 +420,13 @@ Products behave just like any other element, in Twig. Once you’ve loaded a pro
414
420
### Variants and Pricing
415
421
416
422
Products don’t have a price, despite what the Shopify UI might imply—instead, every product has at least one
You can get an array of variant objects for a product by calling [`product.getVariants()`](#productgetvariants). The product element also provides convenience methods for getting the [default](#productgetdefaultvariant) and [cheapest](#productgetcheapestvariant) variants, but you can filter them however you like with Craft’s [`collect()`](https://craftcms.com/docs/4.x/dev/functions.html#collect) Twig function.
420
426
421
427
Unlike products, variants in Craft…
422
428
423
-
- …are represented exactly as [the API](https://shopify.dev/api/admin-rest/2022-10/resources/product-variant#resource-object) returns them;
429
+
- …are represented exactly as [the API](https://shopify.dev/api/admin-rest/2023-10/resources/product-variant#resource-object) returns them;
424
430
- …use Shopify’s convention of underscores in property names instead of exposing [camel-cased equivalents](#native-attributes);
0 commit comments