在Prestashop中获取产品标签

时间:2012-11-30 23:23:46

标签: prestashop

我是Prestashop的新手,我真的很挣扎。缺乏良好的文档是一个非常不利的问题,有时我会像尝试Magento或类似的东西一样。

无论如何,如果该产品标有某个标签,我正试图让产品页面显示信息。我在互联网上搜索了大约3个小时,但找不到任何解决这个问题的东西。

我该怎么办?你们中的任何人都可以给我一个方向吗?

是的,我正在使用1.5

谢谢

2 个答案:

答案 0 :(得分:4)

如果您使用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)];

答案 1 :(得分:0)

您可以查看Product类。例如:Tag :: getProductTags($ id_product)function

此致

相关问题