diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 040cfe1..7886e41 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -16,7 +16,7 @@ jobs:
name: ci
uses: craftcms/.github/.github/workflows/ci.yml@v3
with:
- craft_version: '4'
+ craft_version: '5'
jobs: '["ecs", "phpstan", "prettier"]'
notify_slack: true
slack_subteam:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7ba55f0..3323c06 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Release Notes for Shopify
+## 5.0.0 - Unreleased
+
+- Added Craft CMS 5 compatibility.
+
## 4.0.0 - 2023-11-02
> [!IMPORTANT]
diff --git a/README.md b/README.md
index 644c25c..68fed09 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ Build a content-driven storefront by synchronizing [Shopify](https://shopify.com
## Installation
-The Shopify plugin requires Craft CMS 4.0.0 or later.
+The Shopify plugin requires Craft CMS 5.0.0 or later.
To install the plugin, visit the [Plugin Store](https://plugins.craftcms.com/shopify) from your Craft project, or follow these instructions.
@@ -79,7 +79,7 @@ SHOPIFY_HOSTNAME="my-storefront.myshopify.com"
Now that you have credentials for your custom app, it’s time to add them to Craft.
1. Visit the **Shopify** → **Settings** screen in your project’s control panel.
-2. Assign the four environment variables to the corresponding settings, using the special [config syntax](https://craftcms.com/docs/4.x/config/#control-panel-settings):
+2. Assign the four environment variables to the corresponding settings, using the special [config syntax](https://craftcms.com/docs/5.x/config/#control-panel-settings):
- **API Key**: `$SHOPIFY_API_KEY`
- **API Secret Key**: `$SHOPIFY_API_SECRET_KEY`
- **Access Token**: `$SHOPIFY_ACCESS_TOKEN`
@@ -87,7 +87,7 @@ Now that you have credentials for your custom app, it’s time to add them to Cr
3. Click **Save**.
> **Note**
-> These settings are stored in [Project Config](https://craftcms.com/docs/4.x/project-config.html), and will be automatically applied in other environments. [Webhooks](#set-up-webhooks) will still need to be configured for each environment!
+> These settings are stored in [Project Config](https://craftcms.com/docs/5.x/project-config.html), and will be automatically applied in other environments. [Webhooks](#set-up-webhooks) will still need to be configured for each environment!
### Set up Webhooks
@@ -107,13 +107,9 @@ Before upgrading ensure that the **Admin API access scopes** match the [requirem
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.
-### To v4.x
-
-After updating to Shopify v4.x, visit your Shopify store and go to **Settings** → **Apps and sales channels** → **Develop apps** → [your app] → **Configuration**, and update the **Webhook version** setting to `2023-10`.
-
## Product Element
-Products from your Shopify store are represented in Craft as product [elements](https://craftcms.com/docs/4.x/elements.html), and can be found by going to **Shopify** → **Products** in the control panel.
+Products from your Shopify store are represented in Craft as product [elements](https://craftcms.com/docs/5.x/elements.html), and can be found by going to **Shopify** → **Products** in the control panel.
### Synchronization
@@ -225,7 +221,7 @@ For your administrators, you can even link directly to the Shopify admin:
### Custom Fields
-Products synchronized from Shopify have a dedicated field layout, which means they support Craft’s full array of [content tools](https://craftcms.com/docs/4.x/fields.html).
+Products synchronized from Shopify have a dedicated field layout, which means they support Craft’s full array of [content tools](https://craftcms.com/docs/5.x/fields.html).
The product field layout can be edited by going to **Shopify** → **Settings** → **Products**, and scrolling down to **Field Layout**.
@@ -263,7 +259,7 @@ A new query begins with the `craft.shopifyProducts` factory function:
### Query Parameters
-The following element query parameters are supported, in addition to [Craft’s standard set](https://craftcms.com/docs/4.x/element-queries.html).
+The following element query parameters are supported, in addition to [Craft’s standard set](https://craftcms.com/docs/5.x/element-queries.html).
> **Note**
> Fields stored as JSON (like `options` and `metadata`) are only queryable as plain text. If you need to do advanced organization or filtering, we recommend using custom Category or Tag fields in your Product [field layout](#custom-fields).
@@ -331,7 +327,7 @@ Show only products that are published to a matching sales channel.
#### `tags`
-Tags are stored as a comma-separated list. You may see better results using [the `.search()` param](https://craftcms.com/docs/4.x/searching.html#development).
+Tags are stored as a comma-separated list. You may see better results using [the `.search()` param](https://craftcms.com/docs/5.x/searching.html#development).
```twig
{# Find products whose tags include the term in any position, with variations on casing: #}
@@ -353,7 +349,7 @@ Filter by the vendor information from Shopify.
#### `images`
-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).
+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/5.x/searching.html#development).
```twig
{# Find products that have an image resource mentioning "stripes": #}
@@ -364,7 +360,7 @@ Images are stored as a blob of JSON, and only intended for use in a template in
#### `options`
-[Options](#using-options) are stored as a blob of JSON, and only intended for use in a template in conjunction with a loaded product. You may see better results using [the `.search()` param](https://craftcms.com/docs/4.x/searching.html#development).
+[Options](#using-options) are stored as a blob of JSON, and only intended for use in a template in conjunction with a loaded product. You may see better results using [the `.search()` param](https://craftcms.com/docs/5.x/searching.html#development).
```twig
{# Find products that use a "color" option: #}
@@ -422,7 +418,7 @@ Products behave just like any other element, in Twig. Once you’ve loaded a pro
Products don’t have a price, despite what the Shopify UI might imply—instead, every product has at least one
[Variant](https://shopify.dev/api/admin-rest/2023-10/resources/product-variant#resource-object).
-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.
+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/5.x/dev/functions.html#collect) Twig function.
Unlike products, variants in Craft…
@@ -440,7 +436,7 @@ Once you have a reference to a variant, you can output its properties:
```
> **Note**
-> The built-in [`currency`](https://craftcms.com/docs/4.x/dev/filters.html#currency) Twig filter is a great way to format money values.
+> The built-in [`currency`](https://craftcms.com/docs/5.x/dev/filters.html#currency) Twig filter is a great way to format money values.
### Using Options
@@ -484,7 +480,7 @@ If you want to let customers pick from options instead of directly select varian