Skip to content

Commit

Permalink
[-] MO: Fix product cover image on blockviewed with multishop
Browse files Browse the repository at this point in the history
  • Loading branch information
rGaillard committed Apr 5, 2013
1 parent bfd3e40 commit b1a1e57
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/blockviewed/blockviewed.php
Expand Up @@ -103,16 +103,16 @@ public function hookRightColumn($params)
$productsImages = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT image_shop.id_image, p.id_product, il.legend, product_shop.active, pl.name, pl.description_short, pl.link_rewrite, cl.link_rewrite AS category_rewrite
FROM '._DB_PREFIX_.'product p
'.Shop::addSqlAssociation('product', 'p').'
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').')
LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product AND i.cover = 1)'.
Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'
LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product)'.
Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'
LEFT JOIN '._DB_PREFIX_.'image_lang il ON (il.id_image = i.id_image)
'.Shop::addSqlAssociation('product', 'p').'
LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = product_shop.id_category_default'.Shop::addSqlRestrictionOnLang('cl').')
WHERE p.id_product IN ('.$productIds.')
AND (i.id_image IS NULL OR image_shop.id_shop='.(int)$this->context->shop->id.')
AND pl.id_lang = '.(int)($params['cookie']->id_lang).'
AND cl.id_lang = '.(int)($params['cookie']->id_lang)
AND cl.id_lang = '.(int)($params['cookie']->id_lang).'
GROUP BY product_shop.id_product'
);

$productsImagesArray = array();
Expand Down

0 comments on commit b1a1e57

Please sign in to comment.