Fertechpl Posted November 19, 2015 Share Posted November 19, 2015 (edited) Witam! Chciałem wyświetlić na stronie produktu główne tagi (nie tagi danego produktu, to już mam ) Niestety przy wywołaniu tpl'ki: {include file="$tpl_dir./modules/blocktags/blocktags.tpl"} dowiedziałem się, że nie mam dostępu do main tagów w product.tpl Próbowałem udostępnić mu je przez ProductController.php i blocktags.php, ale moja wiedza jeszcze jest trochę za mała, także prosiłbym o pomoc. Pozdrawiam! @EDIT (ROZWIĄZANIE): Ok, mam rozwiązanie. Do pliku: ROOT/controllers/front/ProductController.php Do tego: $accessories = $this->product->getAccessories($this->context->language->id); if ($this->product->cache_is_pack || count($accessories)) $this->context->controller->addCSS(_THEME_CSS_DIR_.'product_list.css'); $productTags = Tag::getProductTags($this->product->id); $productTags = $productTags[(int)(self::$cookie->id_lang)]; $this->context->smarty->assign('productTags', $productTags); zaraz za ten kod dodać ten: $tags = Tag::getMainTags((self::$cookie->id_lang), (self::$cookie->id_lang) ); $this->context->smarty->assign('tags', $tags); Potem w pliku: ROOT/themes/TWÓJTHEME/product.tpl Dodajemy linie z wywołaniem bloku TAGS (blocktags.tpl). <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> {include file="$tpl_dir./modules/blocktags/blocktags.tpl"} </div> Powinno zadziałać. Pozdrawiam! Edited November 19, 2015 by Fertechpl (see edit history) Link to comment Share on other sites More sharing options...
Question
Fertechpl
Witam!
Chciałem wyświetlić na stronie produktu główne tagi (nie tagi danego produktu, to już mam )
Niestety przy wywołaniu tpl'ki:
dowiedziałem się, że nie mam dostępu do main tagów w product.tpl
Próbowałem udostępnić mu je przez ProductController.php i blocktags.php, ale moja wiedza jeszcze jest trochę za mała, także prosiłbym o pomoc.
Pozdrawiam!
@EDIT (ROZWIĄZANIE):
Ok, mam rozwiązanie.
Do pliku:
Do tego:
zaraz za ten kod dodać ten:
Potem w pliku:
Dodajemy linie z wywołaniem bloku TAGS (blocktags.tpl).
Powinno zadziałać.
Pozdrawiam!
Edited by Fertechpl (see edit history)Link to comment
Share on other sites
0 answers to this question
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