-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for multiple versions of the Shopify API
- Loading branch information
1 parent
8771dda
commit d44fad1
Showing
11 changed files
with
676 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
# Release Notes for Shopify 5.3 (WIP) | ||
|
||
- It is now possible to set the API version in the plugin settings. | ||
- Added Craft CMS 4 compatibility. | ||
- Added support for selecting products in Link fields. | ||
- Syncing products now returns presentment prices by default. ([#122](https://github.com/craftcms/shopify/issues/122)) | ||
- Added `craft\shopify\linktypes\Product`. | ||
- Added `craft\shopify\linktypes\Product`. | ||
- Added `craft\shopify\models\Settings::getApiVersion()`. | ||
- Added `craft\shopify\models\Settings::setApiVersion()`. | ||
- Added `craft\shopify\services\Api::getMetaFieldClass()`. | ||
- Added `craft\shopify\services\Api::getProductClass()`. | ||
- Added `craft\shopify\services\Api::getSupportedApiVersions()`. | ||
- Added `craft\shopify\services\Api::getVariantClass()`. | ||
- Deprecated `craft\shopify\services\Api::SHOPIFY_API_VERSION`. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace craft\shopify\migrations; | ||
|
||
use Craft; | ||
use craft\db\Migration; | ||
|
||
/** | ||
* m241218_145031_set_api_version migration. | ||
*/ | ||
class m241218_145031_set_api_version extends Migration | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public function safeUp(): bool | ||
{ | ||
// Don't make the same config changes twice | ||
$projectConfig = Craft::$app->getProjectConfig(); | ||
$schemaVersion = $projectConfig->get('plugins.shopify.schemaVersion', true); | ||
|
||
if (version_compare($schemaVersion, '5.3.0', '<')) { | ||
$muteEvents = $projectConfig->muteEvents; | ||
$projectConfig->muteEvents = true; | ||
|
||
$projectConfig->set('plugins.shopify.settings.apiVersion', '2023-10', 'Save the current Shopify API version'); | ||
$projectConfig->muteEvents = $muteEvents; | ||
} | ||
|
||
return true; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function safeDown(): bool | ||
{ | ||
echo "m241218_145031_set_api_version cannot be reverted.\n"; | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.