FilipBlahout Posted April 19, 2016 Share Posted April 19, 2016 Dobrý den, vypisuji si kategorie v bloku kategorií podle: $id_customer = (int)$params['cookie']->id_customer; $id_group = $id_customer ? Customer::getDefaultGroupId($id_customer) : _PS_DEFAULT_CUSTOMER_GROUP_; $id_lang = (int)$params['cookie']->id_lang; $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' SELECT c.*, cl.* FROM `'._DB_PREFIX_.'category` c LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.$id_lang.') LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`) WHERE level_depth > 2 And level_depth < 4 AND id_parent = 425 AND c.`active` = 1 AND cg.`id_group` = '.$id_group.' ORDER BY `level_depth` ASC, c.`position` ASC'); $category = new Category(1); $nb = intval(Configuration::get('HOME_categories_NBR')); Nyní jsem nastavil multistore, na nový shop převedl vše, včetně stromu kategorií. Blok kategorií však nyný zobrazuje veškeré kategorie 2x. Nedaří se mí kod ošetřit tak, aby to zobrazovalo vždy ty kategorie jen jednou, pro daný shop. Budu rád za nasměřování. Díky Link to comment Share on other sites More sharing options...
FilipBlahout Posted April 19, 2016 Author Share Posted April 19, 2016 Vyřešeno: LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.(int)$this->context->language->id.Shop::addSqlRestrictionOnLang('cl').') LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (cs.`id_category` = c.`id_category` AND cs.`id_shop` = '.(int)$this->context->shop->id.') LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`) Link to comment Share on other sites More sharing options...
XM4N Posted October 21, 2016 Share Posted October 21, 2016 (edited) Třeba se vám bude líbit i tento příspěvek pro zrychlení načítání kategorií v eshopu https://www.prestashop.com/forums/topic/562475-jak-zrychlit-prestashop-16-s-minimem-%C3%BAprav/ Edited October 21, 2016 by XM4N (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now