diff --git a/CHANGELOG.md b/CHANGELOG.md index 35c3237d..51905502 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Release Notes for Feed Me +## Unreleased + +- Fixed a PHP error that could occur if you did not have Commerce installed when running a feed. ([#1556](https://github.com/craftcms/feed-me/issues/1556)) + ## 6.6.0 - 2024-11-26 - Added the `assetDownloadGuzzle` config setting which defaults to `false`. When it is set to `true`, Feed Me will use Guzzle to download assets instead curl directly. ([#1549](https://github.com/craftcms/feed-me/pull/1549)) diff --git a/src/elements/CommerceProduct.php b/src/elements/CommerceProduct.php index a75422b4..52466c95 100644 --- a/src/elements/CommerceProduct.php +++ b/src/elements/CommerceProduct.php @@ -145,8 +145,9 @@ public function init(): void // After the feed has run, create a catalog pricing job to update the pricing Event::on(Process::class, Process::EVENT_AFTER_PROCESS_FEED, function(FeedProcessEvent $event) { - $this->_runCatalogPricingJob = true; - Commerce::getInstance()->getCatalogPricing()->createCatalogPricingJob(); + if (Craft::$app->getPlugins()->isPluginEnabled('commerce') && $this->_runCatalogPricingJob = true) { + Commerce::getInstance()->getCatalogPricing()->createCatalogPricingJob(); + } }); }