// Fix all product_lang sql restrictions with multishop

This commit is contained in:
rMalie
2011-08-19 14:01:23 +00:00
parent e3f21b76e6
commit fb55cfcd11
26 changed files with 146 additions and 141 deletions
+6 -3
View File
@@ -110,9 +110,12 @@ class AttachmentCore extends ObjectModel
{
foreach($list as $attachement)
$ids_attachements[] = $attachement['id_attachment'];
$tmp = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'product_attachment` pa
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pa.`id_product` = pl.`id_product`)
WHERE `id_attachment` IN ('.implode(',', array_map('intval', $ids_attachements)).') AND pl.`id_lang` = '.(int)$id_lang.';');
$sql = 'SELECT * FROM `'._DB_PREFIX_.'product_attachment` pa
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pa.`id_product` = pl.`id_product`'.Context::getContext()->shop->sqlLang('pl').')
WHERE `id_attachment` IN ('.implode(',', array_map('intval', $ids_attachements)).')
AND pl.`id_lang` = '.(int)$id_lang;
$tmp = Db::getInstance()->executeS($sql);
$productAttachements = array();
foreach($tmp as $t)
$productAttachements[$t['id_attachment']][] = $t['name'];