// Fix bugs with category positions
This commit is contained in:
@@ -162,14 +162,14 @@ class AdminCategoriesControllerCore extends AdminController
|
||||
else
|
||||
$id_parent = $this->context->shop->id_category;
|
||||
|
||||
$this->_select = 'sa.position position';
|
||||
$this->_filter .= ' AND `id_parent` = '.(int)$id_parent.' ';
|
||||
if (Shop::isFeatureActive())
|
||||
{
|
||||
if (Shop::getContext() == Shop::CONTEXT_SHOP)
|
||||
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = '.(int)$this->context->shop->id.') ';
|
||||
else
|
||||
|
||||
if (Shop::getContext() == Shop::CONTEXT_SHOP)
|
||||
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = '.(int)$this->context->shop->id.') ';
|
||||
else
|
||||
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = a.id_shop_default) ';
|
||||
}
|
||||
|
||||
|
||||
// we add restriction for shop
|
||||
if (Shop::getContext() == Shop::CONTEXT_SHOP && $is_multishop)
|
||||
@@ -201,9 +201,7 @@ class AdminCategoriesControllerCore extends AdminController
|
||||
|
||||
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
|
||||
{
|
||||
$alias = 'a';
|
||||
if (Shop::isFeatureActive())
|
||||
$alias = 'sa';
|
||||
$alias = 'sa';
|
||||
parent::getList($id_lang, $alias.'.position', $order_way, $start, $limit, Context::getContext()->shop->id);
|
||||
// Check each row to see if there are combinations and get the correct action in consequence
|
||||
|
||||
|
||||
@@ -158,7 +158,6 @@ class AdminImportControllerCore extends AdminController
|
||||
'minimal_quantity' => 1,
|
||||
'weight' => 0,
|
||||
'default_on' => 0,
|
||||
'shop' => Configuration::get('PS_SHOP_DEFAULT'),
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -258,7 +257,6 @@ class AdminImportControllerCore extends AdminController
|
||||
'link_rewrite' => array((int)Configuration::get('PS_LANG_DEFAULT') => ''),
|
||||
'online_only' => 0,
|
||||
'condition' => 'new',
|
||||
'shop' => Configuration::get('PS_SHOP_DEFAULT'),
|
||||
'date_add' => date('Y-m-d H:i:s'),
|
||||
'condition' => 'new',
|
||||
);
|
||||
@@ -1012,8 +1010,10 @@ class AdminImportControllerCore extends AdminController
|
||||
AdminImportController::setEntityDefaultValues($product);
|
||||
AdminImportController::arrayWalk($info, array('AdminImportController', 'fillInfo'), $product);
|
||||
|
||||
if (!Shop::isFeatureActive() || !isset($product->shop) || empty($product->shop))
|
||||
if (!Shop::isFeatureActive())
|
||||
$product->shop = 1;
|
||||
elseif (!isset($product->shop) || empty($product->shop))
|
||||
$product->shop = implode($this->multiple_value_separator, Shop::getContextListShopID());
|
||||
|
||||
if (!Shop::isFeatureActive())
|
||||
$product->id_shop_default = 1;
|
||||
@@ -1457,6 +1457,9 @@ class AdminImportControllerCore extends AdminController
|
||||
|
||||
// Get shops for each attributes
|
||||
$info['shop'] = explode($this->multiple_value_separator, $info['shop']);
|
||||
if (!isset($info['shop']) || !count($info['shop']))
|
||||
$info['shop'] = Shop::getContextListShopID();
|
||||
|
||||
$id_shop_list = array();
|
||||
foreach ($info['shop'] as $shop)
|
||||
if (!is_numeric($shop))
|
||||
|
||||
Reference in New Issue
Block a user