2012-11-30 75 views
1

我是Prestashop的新手,我非常努力。缺乏良好的文档是一个非常不利的方面,有时候我会像尝试Magento或类似的东西一样倒下。在Prestashop中获取产品的标签

无论如何,我试图让一个产品页面只显示一个信息,如果该产品被标记了某个标签。我在互联网上搜索了大约3个小时,但找不到解决此问题的任何内容。

我该怎么办?请问你们任何人请给我一个方向?

顺便说一句,我使用的是1.5

感谢

回答

3

,如果你使用的prestashop 1.5,你需要

//this is your prooduct id that you get it from your url 
    $id_product=Tools::getValue('id_product'); 
    //the you use it to return all of your tags of this product with this id product 
    //but this return two array for example: array(array(tags)) 
    $productTags =Tag::getProductTags($id_product); 
    //add this code return array(tags) ; 
    $productTags=$productTags[intval(Context::getContext()->cookie->id_lang)]; 
0

你可以看看产品类中。例如:标签:: getProductTags($ id_product)功能

问候

+0

我给它一个尝试,并报告 – Souljacker