Jump to content

Tags block in product page


Recommended Posts

I want to display the tags block in the product page, under the description. I've tried to translate the tags module in Product footer hook, but it didn't display. I've tried also in HOOK_PRODUCT_TAB_CONTENT but it says that it is already there. In what hook shoud I translate it?

Oh, and I want this block to display only the specific product's tags in which page is displayed.

Link to comment
Share on other sites

Hmmm, nobody?

I saw there is a function in classes/Tag.php called getProductTags($id_product)

static public function getProductTags($id_product)
   {
        if (!$tmp = Db::getInstance()->ExecuteS('
       SELECT t.`id_lang`, t.`name` 
       FROM '._DB_PREFIX_.'tag t 
       LEFT JOIN '._DB_PREFIX_.'product_tag pt ON (pt.id_tag = t.id_tag) 
       WHERE pt.`id_product`='.intval($id_product)))
            return false;
        $result = array();
        foreach ($tmp AS $tag)
            $result[$tag['id_lang']][] = $tag['name'];
        return $result;
    }



but from what I have seen, it isn't used anywhere.

So, please, how can I use this function to display the tags related to a product on the product footer's page?

Link to comment
Share on other sites

  • 3 months later...

The tags block will not display on the product page because it was not designed to be placed there. You must add the following code to modules/blocktags/blocktags.php before the last }:

function hookProductFooter($params)
{
   return $this->hookLeftColumn($params);    
}



Then you can transplant the tags module into the Product footer hook and it will display the same way as it does when it placed in a column. You will need to do more work to make it look good in that position.

Link to comment
Share on other sites

  • 1 month later...

Hi Rocky / All,

Thanks a lot for your inputs. I want to add tags in product-list.tpl below the short product description. Could you advise me, which hook i need to use. I am able to display tags in product footer but i need it on product-list.tpl .


Thanks in advance

Regards

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

Hi,

I am also having this problem!

I have managed to display the tags block in the product footer, but the main problem is that all the tags I have created are showing up instead of the ones that I have just added to a specific product.

There must be a simple solution for this what I am missing!

Its driving me crazy

Thanks in advance..

Link to comment
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...