Commit ffdf6b87 authored by Karamel's avatar Karamel
Browse files

Don't include archived products with v7 import.

parent 4d468697
......@@ -406,7 +406,7 @@ $stmt = $pdo->prepare('select * from PRODUCTS');
$prdMapping = [];
$compositions = [];
if ($stmt->execute()) {
$stmt2 = $pdo->prepare('select * from PRODUCTS_CAT where PRODUCTS = :id');
$stmt2 = $pdo->prepare('select * from PRODUCTS_CAT where PRODUCT = :id');
while ($row = $stmt->fetch()) {
if (readBool($row['DELETED'])) {
continue;
......@@ -421,8 +421,13 @@ if ($stmt->execute()) {
$prd->setScaled($row['ISSCALE']);
$stmt2->bindValue(':id', $row['ID']);
if ($stmt2->execute()) {
if ($row = $stmt2->fetch() && !empty($row['CATORDER'])) {
$prd->setDispOrder($row['CATORDER']);
if ($row2 = $stmt2->fetch()) {
if (!empty($row2['CATORDER'])) {
$prd->setDispOrder($row2['CATORDER']);
}
} else {
// Not sold, don't include it to clean database.
continue;
}
} else {
// Ignore
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment