Merge branch 'ticket-eanUpgrade' into develop

This commit is contained in:
Marion Muszynski 2016-09-19 18:07:21 +02:00
commit 61b198a9c1

View File

@ -71,19 +71,21 @@ function getProductId()
if (empty($result)) {
$result = Db::getInstance()->getRow('
SELECT pa.*, pl.`name`, p.`reference` as product_reference, al.`name` as attribute_name, i.`id_image`
SELECT pa.*, pl.`name`, p.`reference` as product_reference, al.`name` as attribute_name, ia.`id_image` as id_image_attribute, i.`id_image`
FROM `'._DB_PREFIX_.'product_attribute` pa
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = pa.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (al.`id_attribute` = pac.`id_attribute`)
LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` i ON (i.`id_product_attribute` = pa.`id_product_attribute`)
LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` ia ON (ia.`id_product_attribute` = pa.`id_product_attribute`)
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1)
WHERE pa.`ean13` = '.pSQL($ean).'
AND pl.`id_lang` = '.(int)$cookie->id_lang.'
ORDER BY pa.`id_product_attribute` DESC
-- ORDER BY pa.`id_product_attribute` ASC'
);
$result['reference'] = (!empty($result['reference'])) ? $result['reference'] : $result['product_reference'];
$result['id_image'] = (!empty($result['id_image_attribute'])) ? $result['id_image_attribute'] : $result['id_image'];
}
/*$category_name = Db::getInstance()->getRow('