[-] BO: Fix combinations creation on multistore

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16292 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-07-09 15:41:07 +00:00
parent 1b72cbdee1
commit 8343cb58d5
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -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
View File
@@ -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 */