Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Add optional `status` column for product imports and exports.
- Refactor the Export Product sidebar button.
- Set `promotable` to true by default

## 2.0.5 - 2026-02-19

Expand Down
1 change: 1 addition & 0 deletions src/controllers/ProductVariantsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function actionProductExists(): Response
if ($productId !== null) {
$product = Product::find()
->id(Db::escapeParam($productId))
->status(null)
->one();

if ($product === null) {
Expand Down
7 changes: 6 additions & 1 deletion src/services/Csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,18 @@ private function importSiteSpecificData(TabularDataReader $reader, $skuColumn, a
$variant->availableForPurchase = true;
}

if ($data->firstWhere('field', 'promotable') === null) {
// If the promotable field does not exist, then we will default it to true
$variant->promotable = true;
}

foreach ($data as $fieldData) {
$field = $fieldData['field'];
$properties = [
$field => $record[$fieldData['index']],
];

if ($field === 'availableForPurchase') {
if ($field === 'availableForPurchase' || $field === 'promotable') {
$value = $properties[$field];
if ($value === null || $value === '') {
// Default it to true if it's set but null or empty
Expand Down
Loading