Jump to content

Recommended Posts

Hi,

For some reason the blocktags module duplicates the product tags. The tags theirselves are unique, when I check in BO Catalogue > Tags

Please Help!

 

Update: And if anybody knows – how can I show the levels of tags in 1.6 ? (size of font)

post-540630-0-11969900-1463407980_thumb.png

Share this post


Link to post
Share on other sites
  • 3 months later...
  • 3 years later...

Happened to me too, solved changing code from classes/tag.php.

 

Go to function getMainTags($id_lang, $nb = 10), and change both SELECT queries adding DISTINCT.

if (Group::isFeatureActive()) {
            $groups = FrontController::getCurrentCustomerGroups();
            return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
			SELECT DISTINCT t.name, counter AS times
			FROM `'._DB_PREFIX_.'tag_count` pt
			LEFT JOIN `'._DB_PREFIX_.'tag` t ON (t.id_tag = pt.id_tag)
			WHERE pt.`id_group` '.(count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1').'
			AND pt.`id_lang` = '.(int)$id_lang.' AND pt.`id_shop` = '.(int)$context->shop->id.'
			ORDER BY times DESC
			LIMIT '.(int)$nb);
        } else {
            return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
			SELECT DISTINCT t.name, counter AS times
			FROM `'._DB_PREFIX_.'tag_count` pt
			LEFT JOIN `'._DB_PREFIX_.'tag` t ON (t.id_tag = pt.id_tag)
			WHERE pt.id_group = 0 AND pt.`id_lang` = '.(int)$id_lang.' AND pt.`id_shop` = '.(int)$context->shop->id.'
			ORDER BY times DESC
			LIMIT '.(int)$nb);
        }

 

Share this post


Link to post
Share on other sites

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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More