Merge branch 'ticket-14436-WP' into develop

This commit is contained in:
Marion Muszynski 2017-11-06 17:37:05 +01:00
commit 7b61800173
2 changed files with 17 additions and 6 deletions

View File

@ -137,7 +137,7 @@ class AdminAntWp extends AdminTab
$ids = array();
foreach (Db::getInstance()->executeS('
SELECT p.`id_product`, p.`id_tax_rules_group`, p.`id_category_default`, p.`ean13`, p.`price`, p.`wholesale_price`,
p.`reference`, p.`supplier_reference`, p.`weight`, p.`height`, p.`width`, p.`depth`, c.`position`, cu.*
p.`reference`, p.`supplier_reference`, p.`weight`, p.`height`, p.`width`, p.`depth`, c.`position`, cu.`nc8`, cu.`id_country`
FROM
`'._DB_PREFIX_.'product` p
INNER JOIN (SELECT date_add, max(id_product) as maxid FROM `'._DB_PREFIX_.'product` GROUP BY ean13) as b
@ -148,6 +148,7 @@ class AdminAntWp extends AdminTab
ON (cu.`id_product` = p.`id_product`)
WHERE p.`ean13` IN ("'.implode('","',$eans).'")
'.(!empty($refs)?' OR p.`supplier_reference` IN ("'.implode('","',$refs).'")':'').'
AND p.`id_product` IS NOT NULL
ORDER BY c.`position`
') as $row) {
if($row['ean13']!='' && isset($products[$row['ean13']])){
@ -160,11 +161,10 @@ class AdminAntWp extends AdminTab
$ids[] = (int)$row['id_product'];
}
}
$new_products = count($products) - $product_found;
foreach (Db::getInstance()->executeS('
SELECT p.`id_product`, p.`id_tax_rules_group`, p.`id_category_default`, at.`ean13`, p.`price`, p.`wholesale_price`,
p.`reference`, p.`supplier_reference`, p.`weight`, p.`height`, p.`width`, p.`depth`, c.`position`, cu.*
p.`reference`, p.`supplier_reference`, p.`weight`, p.`height`, p.`width`, p.`depth`, c.`position`, cu.`nc8`, cu.`id_country`
FROM
`'._DB_PREFIX_.'product` p
INNER JOIN (SELECT date_add, max(id_product) as maxid FROM `'._DB_PREFIX_.'product` GROUP BY `supplier_reference`) as b
@ -176,6 +176,7 @@ class AdminAntWp extends AdminTab
LEFT JOIN `'._DB_PREFIX_.'product_attribute` at
ON (at.`id_product` = p.`id_product`)
WHERE at.`ean13` IN ("'.implode('","',$eans).'")
AND p.`id_product` IS NOT NULL
ORDER BY c.`position`
') as $row) {
if($row['ean13']!='' && isset($products[$row['ean13']])){
@ -191,6 +192,7 @@ class AdminAntWp extends AdminTab
$ids[] = (int)$row['id_product'];
}
}
$new_products = count($products) - $product_found;
if(!empty($ids)){
foreach (Db::getInstance()->executeS('

File diff suppressed because one or more lines are too long