From 994f721abcfb2edb1946e37bd2d8371f87791970 Mon Sep 17 00:00:00 2001 From: Jacek Pyziak Date: Mon, 9 Jun 2025 23:29:11 +0200 Subject: [PATCH] feat(import-product): Update product size and last modified time in sync cache; add EAN check in product combinations --- .vscode/ftp-kr.sync.cache.json | 4 ++-- import-product.php | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.vscode/ftp-kr.sync.cache.json b/.vscode/ftp-kr.sync.cache.json index d68143a5..c5595cb1 100644 --- a/.vscode/ftp-kr.sync.cache.json +++ b/.vscode/ftp-kr.sync.cache.json @@ -1638,8 +1638,8 @@ }, "import-product.php": { "type": "-", - "size": 32213, - "lmtime": 1749162688552, + "size": 32611, + "lmtime": 1749496861877, "modified": false }, "index.php": { diff --git a/import-product.php b/import-product.php index d38d2ed8..865ba428 100644 --- a/import-product.php +++ b/import-product.php @@ -78,6 +78,9 @@ foreach ( $products_array as $product ) 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']) . '\''; $result_combination = Db::getInstance()->execute($sql_combination);