0
votes

I use Magento 1.9 and I need to get the tags of any single product on cart page https://github.com/OpenMage/magento-mirror/blob/magento-1.9/app/design/frontend/base/default/template/checkout/cart/item/default.phtml, there is a loop and the product is taken with $_item = $this->getItem();, I take the products with

Mage::getSingleton('catalog/product')->load($_item->getProductId());

but I can't understand how I can take the Magento product tags (https://www.hostknox.com/tutorials/magento/tags) of the single product in this cart page.

Thanks

1
Please elaborate your questionA.Rashad
@Parth Trivedi I've just tried this solution but it doesn't workvendocartoni

1 Answers

0
votes

resolved

$model = Mage::getModel('tag/tag');
    $TaGCollection= $model->getResourceCollection()
            ->addPopularity()
            ->addStatusFilter($model->getApprovedStatus())
            ->addProductFilter($_item->getProduct()->getId())
            ->setFlag('relation', true)
            ->addStoreFilter(Mage::app()->getStore()->getId())
            ->setActiveFilter()
            ->load();
    $Tags=$TaGCollection->getItems();

    if(count($Tags)) {
        echo '<ul>';
        foreach ($Tags as $tag) {
            //echo  $tag->getTaggedProductsUrl();
            echo '<li>';
            echo $tag->getName();
            echo '</li>';
        }
        echo '</ul>';
    } //if(count($Tags)) {