// Blcklayered: Add some row to select statement of the product query

This commit is contained in:
mDeflotte
2012-03-12 10:47:01 +00:00
parent 6281b4dbbc
commit 85c86c5b50
+8 -4
View File
@@ -2396,10 +2396,14 @@ class BlockLayered extends Module
$alias = 'asso_shop_product';
}
$this->products = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT p.id_product, p.on_sale, p.out_of_stock, p.available_for_order, p.quantity, p.minimal_quantity, '.$alias.'.id_category_default, p.customizable, p.show_price, p.`weight`,
p.ean13, pl.available_later, pl.description_short, pl.link_rewrite, pl.name, i.id_image, il.legend, m.name manufacturer_name, p.condition, p.id_manufacturer,
DATEDIFF(p.`date_add`,
DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 AS new
SELECT
p.*,
'.$alias.'.id_category_default,
pl.available_later, pl.description_short, pl.link_rewrite, pl.name,
i.id_image,
il.legend,
m.name manufacturer_name,
DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 AS new
FROM `'._DB_PREFIX_.'category_product` cp
LEFT JOIN '._DB_PREFIX_.'category c ON (c.id_category = cp.id_category)
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product`