feat(import-product): Update product size and last modified time in sync cache; add EAN check in product combinations
This commit is contained in:
4
.vscode/ftp-kr.sync.cache.json
vendored
4
.vscode/ftp-kr.sync.cache.json
vendored
@@ -1638,8 +1638,8 @@
|
|||||||
},
|
},
|
||||||
"import-product.php": {
|
"import-product.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 32213,
|
"size": 32611,
|
||||||
"lmtime": 1749162688552,
|
"lmtime": 1749496861877,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"index.php": {
|
"index.php": {
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ foreach ( $products_array as $product )
|
|||||||
|
|
||||||
foreach ( $product['combinations'] as $combination )
|
foreach ( $product['combinations'] as $combination )
|
||||||
{
|
{
|
||||||
|
if ( empty( $combination['ean'] ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
$sql_combination = 'UPDATE `' . _DB_PREFIX_ . 'product_attribute` SET `price` = ' . (float)$combination['price'] . ' WHERE `reference` = \'' . pSQL($combination['ean']) . '\'';
|
$sql_combination = 'UPDATE `' . _DB_PREFIX_ . 'product_attribute` SET `price` = ' . (float)$combination['price'] . ' WHERE `reference` = \'' . pSQL($combination['ean']) . '\'';
|
||||||
$result_combination = Db::getInstance()->execute($sql_combination);
|
$result_combination = Db::getInstance()->execute($sql_combination);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user