Skip to content

Commit

Permalink
Merge pull request #1557 from craftcms/bugfix/commerce
Browse files Browse the repository at this point in the history
Fix #1556
  • Loading branch information
angrybrad authored Dec 2, 2024
2 parents b888f1e + c9b2b54 commit 5c0ca17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
5 changes: 3 additions & 2 deletions src/elements/CommerceProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});
}

Expand Down

0 comments on commit 5c0ca17

Please sign in to comment.