fix: Update product activation status and enhance logging in import process

This commit is contained in:
2025-06-09 21:24:19 +02:00
parent 7551e5db04
commit ebb42a29fc
2 changed files with 26 additions and 15 deletions

View File

@@ -7537,19 +7537,19 @@
},
"google-merchant_id-1.xml": {
"type": "-",
"size": 64642672,
"size": 64654174,
"lmtime": 0,
"modified": true
},
"google-merchant_id-2.xml": {
"type": "-",
"size": 2976341,
"size": 2995780,
"lmtime": 0,
"modified": true
},
".htaccess": {
"type": "-",
"size": 13596,
"size": 13595,
"lmtime": 1743185107915,
"modified": true
},
@@ -7559,6 +7559,12 @@
"lmtime": 0,
"modified": false
},
".htaccess.2025-06-06-1749205569": {
"type": "-",
"size": 13596,
"lmtime": 0,
"modified": false
},
"iadmin": {
"themes": {
"default": {
@@ -11780,9 +11786,9 @@
},
"import-product.php": {
"type": "-",
"size": 32213,
"size": 31409,
"lmtime": 1749162646583,
"modified": false
"modified": true
},
"index.php": {
"type": "-",
@@ -22881,14 +22887,14 @@
},
"dr_materac.css": {
"type": "-",
"size": 80327,
"lmtime": 1749162968077,
"size": 80444,
"lmtime": 1749468575575,
"modified": false
},
"dr_materac.css.map": {
"type": "-",
"size": 31129,
"lmtime": 1749162968079,
"size": 31220,
"lmtime": 1749468575577,
"modified": false
},
"dr_materac.css.sync-conflict-20231027-195928-EDGUH2C.map": {
@@ -22899,8 +22905,8 @@
},
"dr_materac.scss": {
"type": "-",
"size": 97457,
"lmtime": 1749162968080,
"size": 97725,
"lmtime": 1749468575579,
"modified": false
},
"dr_materac.sync-conflict-20231027-195844-EDGUH2C.css": {
@@ -50057,8 +50063,8 @@
},
"detail1526395446.tpl": {
"type": "-",
"size": 29810,
"lmtime": 1748904347660,
"size": 29955,
"lmtime": 1749468452055,
"modified": false
},
"detail1526396195.tpl": {

View File

@@ -55,7 +55,7 @@ foreach ( $products_array as $product )
$price = 0; // jeśli są kombinacje, to cena jest 0
$reference = $product['ean'];
$active = 0; // Ustawienie produktu jako nieaktywny
$active = 1; // Ustawienie produktu jako nieaktywny
// table `materac_product`
if ( $reference )
@@ -68,7 +68,11 @@ foreach ( $products_array as $product )
{
$sql_shop = 'UPDATE `' . _DB_PREFIX_ . 'product_shop` SET `price` = ' . (float)$price . ', `active` = ' . (int)$active . ' WHERE `id_product` = ' . (int)$id['id_product'];
$result_shop = Db::getInstance()->execute($sql_shop);
echo "Zaktualizowano produkt z referencją $reference, id_product: " . $id['id_product'] . ", cena: $price, active: $active<br>";
// get prduct name
$product_name = Db::getInstance()->getValue('SELECT name FROM `' . _DB_PREFIX_ . 'product_lang` WHERE `id_product` = ' . (int)$id['id_product'] . ' AND id_shop = 1 AND `id_lang` = 7');
echo '<br>Aktualizacja produktu: ' . $product_name . ' (ID: ' . $id['id_product'] . ')<br>';
echo "Zaktualizowano produkt z referencją $reference, id_product: " . $id['id_product'] . ", cena: $price, active: $active, nazwa: $product_name<br>";
}
}
@@ -85,6 +89,7 @@ foreach ( $products_array as $product )
echo "Zaktualizowano kombinację z referencją " . $combination['ean'] . ", id_product_attribute: " . $id_combination['id_product_attribute'] . ", cena: " . $combination['price'] . "<br>";
}
}
echo '----------------------------------------<br>';
}
exit;