Jump to content
  • 0

[Rozwiązane] "maintags" Na Stronie Produktu


Fertechpl

Question

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 by Fertechpl (see edit history)
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...