Skip to content

Commit e59dee0

Browse files
Fix SKU limit in import new products
1 parent c9d1bec commit e59dee0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
159159
*/
160160
const URL_KEY = 'url_key';
161161

162+
/**
163+
* SKU max length
164+
*/
165+
const DB_MAX_SKU_LENGTH = 65;
166+
162167
/**
163168
* Attribute cache
164169
*

app/code/Magento/CatalogImportExport/Model/Import/Product/Validator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ protected function textValidation($attrCode, $type)
6969
$val = $this->string->cleanString($this->_rowData[$attrCode]);
7070
if ($type == 'text') {
7171
$valid = $this->string->strlen($val) < Product::DB_MAX_TEXT_LENGTH;
72+
} else if ($attrCode == Product::COL_SKU) {
73+
$valid = $this->string->strlen($val) < Product::DB_MAX_SKU_LENGTH;
7274
} else {
7375
$valid = $this->string->strlen($val) < Product::DB_MAX_VARCHAR_LENGTH;
7476
}

0 commit comments

Comments
 (0)