[-] BO : features are not doubled anymore in multishop #PSCFV-4527

This commit is contained in:
dMetzger
2012-10-01 13:32:54 +00:00
parent 90a72518e6
commit af2bdeb482
2 changed files with 7 additions and 9 deletions
+6 -8
View File
@@ -79,16 +79,14 @@ class FeatureCore extends ObjectModel
* @return array Multiple arrays with feature's data
* @static
*/
public static function getFeatures($id_lang)
public static function getFeatures($id_lang, $with_shop = true)
{
return Db::getInstance()->executeS('
SELECT *
FROM `'._DB_PREFIX_.'feature` f
'.Shop::addSqlAssociation('feature', 'f').'
LEFT JOIN `'._DB_PREFIX_.'feature_lang` fl
ON (f.`id_feature` = fl.`id_feature` AND fl.`id_lang` = '.(int)$id_lang.')
ORDER BY f.`position` ASC
');
SELECT *
FROM `'._DB_PREFIX_.'feature` f
'.($with_shop ? Shop::addSqlAssociation('feature', 'f') : '').'
LEFT JOIN `'._DB_PREFIX_.'feature_lang` fl ON (f.`id_feature` = fl.`id_feature` AND fl.`id_lang` = '.(int)$id_lang.')
ORDER BY f.`position` ASC');
}
/**
@@ -3911,7 +3911,7 @@ class AdminProductsControllerCore extends AdminController
{
if ($this->product_exists_in_shop)
{
$features = Feature::getFeatures($this->context->language->id);
$features = Feature::getFeatures($this->context->language->id, (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP));
foreach ($features as $k => $tab_features)
{