[-] BO: Fix combinations creation on multistore
This commit is contained in:
@@ -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];
|
||||
|
||||
+5
-2
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user