Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development

This commit is contained in:
gRoussac
2013-09-04 15:39:25 +02:00
2 changed files with 4 additions and 5 deletions

View File

@@ -2914,7 +2914,7 @@ class ProductCore extends ObjectModel
* @param Shop $shop
* @return string
*/
public static function sqlStock($product_alias, $product_attribute = 0, $inner_join = false, Shop $shop = null)
public static function sqlStock($product_alias, $product_attribute = null, $inner_join = false, Shop $shop = null)
{
$id_shop = ($shop !== null ? (int)$shop->id : null);
$sql = (($inner_join) ? ' INNER ' : ' LEFT ').'

View File

@@ -445,10 +445,7 @@ class BlockLayered extends Module
static $_MODULES = array();
global $_MODULE;
if (version_compare(_PS_VERSION_,'1.5','>'))
$file = _PS_MODULE_DIR_.$this->name.'/translations/'.Language::getIsoById($id_lang).'.php';
else
$file = _PS_MODULE_DIR_.$this->name.'/'.Language::getIsoById($id_lang).'.php';
if (!array_key_exists($id_lang, $_MODULES))
{
@@ -2393,11 +2390,13 @@ class BlockLayered extends Module
MAX(image_shop.`id_image`) id_image,
il.legend,
m.name manufacturer_name,
DATEDIFF('.$alias_where.'.`date_add`, DATE_SUB(NOW(), INTERVAL '.(int)$nb_day_new_product.' DAY)) > 0 AS new
DATEDIFF('.$alias_where.'.`date_add`, DATE_SUB(NOW(), INTERVAL '.(int)$nb_day_new_product.' DAY)) > 0 AS new,
stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity
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`
'.Shop::addSqlAssociation('product', 'p').'
'.Product::sqlStock('p', null, false, Context::getContext()->shop).'
LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').' AND pl.id_lang = '.(int)$cookie->id_lang.')
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product`)'.
Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'