diff --git a/classes/Dispatcher.php b/classes/Dispatcher.php index e8be5c7d6..304fe4d45 100644 --- a/classes/Dispatcher.php +++ b/classes/Dispatcher.php @@ -564,7 +564,7 @@ class DispatcherCore if (!isset($this->routes[$id_lang][$route_id])) { $query = http_build_query($params, '', '&'); - $index_link = Configuration::get('PS_REWRITING_SETTINGS') ? '' : 'index.php'; + $index_link = $this->use_routes ? '' : 'index.php'; return ($route_id == 'index') ? $index_link.(($query) ? '?'.$query : '') : 'index.php?controller='.$route_id.(($query) ? '&'.$query : '').$anchor; } $route = $this->routes[$id_lang][$route_id]; diff --git a/classes/Product.php b/classes/Product.php index fc49bd610..e292daacf 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -981,15 +981,18 @@ class ProductCore extends ObjectModel return count($result) > 0; } - public function productAttributeExists($attributes_list, $current_product_attribute = false) + public function productAttributeExists($attributes_list, $current_product_attribute = false, Context $context = null) { if (!Combination::isFeatureActive()) return false; + if ($context === null) + $context = Context::getContext(); $result = Db::getInstance()->executeS( 'SELECT pac.`id_attribute`, pac.`id_product_attribute` FROM `'._DB_PREFIX_.'product_attribute` pa + JOIN `'._DB_PREFIX_.'product_attribute_shop` pas ON (pas.id_product_attribute = pa.id_product_attribute) LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pac.`id_product_attribute` = pa.`id_product_attribute`) - WHERE pa.`id_product` = '.(int)$this->id + WHERE pas.id_shop ='.(int)$context->shop->id.' AND pa.`id_product` = '.(int)$this->id ); /* If something's wrong */