Skip to content

Commit

Permalink
Merge branch 'release/2.5.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
joshangell committed May 20, 2021
2 parents c3519db + 0061aa7 commit 3bdf6cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## Unreleased


## 2.5.9 - 2021-05-20

### Changed
- Added the enabled status of the current product to the Feed Me API if the product already exists.


## 2.5.8 - 2021-05-20

### Fixed
Expand Down
8 changes: 8 additions & 0 deletions src/controllers/ProductsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use angellco\vend\models\Settings;
use angellco\vend\Vend;
use Craft;
use craft\commerce\elements\Product;
use craft\db\Paginator;
use craft\elements\Entry;
use craft\helpers\DateTimeHelper;
Expand Down Expand Up @@ -241,9 +242,16 @@ public function actionImport(): Response
}
}

// Get the current product if there is one
$productQuery = Product::find();
$productQuery->status = null;
$productQuery->vendProductId = $rawProduct->vendProductId;
$commerceProduct = $productQuery->one();

$products[] = [
'id' => $rawProduct->vendProductId,
'name' => $rawProduct->title,
'enabled' => $commerceProduct ? $commerceProduct->enabled : false,
'variants' => $variants
];
}
Expand Down

0 comments on commit 3bdf6cc

Please sign in to comment.