Skip to content

Commit

Permalink
Merge pull request #5438 from k-yamamura/feature-productcsvimport
Browse files Browse the repository at this point in the history
商品CSV登録で商品コードの項目がなければ更新を無視するように対応
  • Loading branch information
chihiro-adachi authored Jul 21, 2022
2 parents 3070826 + 0db130e commit 091b3b1
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/Eccube/Controller/Admin/Product/CsvImportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1130,10 +1130,12 @@ protected function createProductClass($row, Product $Product, $data, $headerByKe
}
}

if (isset($row[$headerByKey['product_code']]) && StringUtil::isNotBlank($row[$headerByKey['product_code']])) {
$ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']]));
} else {
$ProductClass->setCode(null);
if (isset($row[$headerByKey['product_code']])) {
if (StringUtil::isNotBlank($row[$headerByKey['product_code']])) {
$ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']]));
} else {
$ProductClass->setCode(null);
}
}

if (!isset($row[$headerByKey['stock_unlimited']])
Expand Down Expand Up @@ -1308,10 +1310,12 @@ protected function updateProductClass($row, Product $Product, ProductClass $Prod
}
}

if (isset($row[$headerByKey['product_code']]) && StringUtil::isNotBlank($row[$headerByKey['product_code']])) {
$ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']]));
} else {
$ProductClass->setCode(null);
if (isset($row[$headerByKey['product_code']])) {
if (StringUtil::isNotBlank($row[$headerByKey['product_code']])) {
$ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']]));
} else {
$ProductClass->setCode(null);
}
}

if (!isset($row[$headerByKey['stock_unlimited']])
Expand Down

0 comments on commit 091b3b1

Please sign in to comment.