Righthe Posted September 28, 2010 Share Posted September 28, 2010 Hi,Is there any way that when the product is clicked, can the related tags be highlighted? Either by color change or font change? Link to comment Share on other sites More sharing options...
rocky Posted September 29, 2010 Share Posted September 29, 2010 Add the following after line 72 of modules/blocktags/blocktags.php (in PrestaShop v1.3.1) to get the tags of the current product: $productTags = array(); if (isset($_GET['id_product'])) { $productTags = Tag::getProductTags(intval($_GET['id_product'])); $productTags = $productTags[intval($params['cookie']->id_lang)]; } $smarty->assign('productTags', $productTags); Then change line 7 of modules/blocktags/blocktags.tpl from: <a href="{$base_dir}search.php?tag={$tag.name|urlencode}" title="{l s='More about' mod='blocktags'} {$tag.name|escape:html:'UTF-8'}" class="{$tag.class} {if $smarty.foreach.myLoop.last}last_item{elseif $smarty.foreach.myLoop.first}first_item{else}item{/if}">{$tag.name|escape:html:'UTF-8'} to: <a href="{$base_dir}search.php?tag={$tag.name|urlencode}" title="{l s='More about' mod='blocktags'} {$tag.name|escape:html:'UTF-8'}" class="{$tag.class} {if $smarty.foreach.myLoop.last}last_item{elseif $smarty.foreach.myLoop.first}first_item{else}item{/if}{if in_array($tag.name, $productTags)} bold{/if}">{$tag.name|escape:html:'UTF-8'} This will make the current product tags bold. You can create your own highlight class in global.css and change the class from bold to highlight to use it instead. Link to comment Share on other sites More sharing options...
Righthe Posted September 29, 2010 Author Share Posted September 29, 2010 Thankyou brother, you are awesome. I am trying to to mess up with Global CSS :-( i am beginner to PHP. Pls help me to know how to change the color and if possible Bold + Color. Link to comment Share on other sites More sharing options...
rocky Posted September 29, 2010 Share Posted September 29, 2010 Use the following instead in modules/blocktags/blocktags.tpl: {$tag.name|escape:html:'UTF-8'} Then add the following to your global.css: div#tags_block_left .highlight { color: red; font-weight: bold } Change red to the colour you want the current product tags to be. Link to comment Share on other sites More sharing options...
Righthe Posted September 29, 2010 Author Share Posted September 29, 2010 Brother, you are great.Thank you very much for instant reply. 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