I want to get 8 product using by tag how to get current product tag id.
$tagId = 1; // I want to get id on view.html
$collection = Mage::getResourceModel('tag/product_collection')
->addAttributeToSelect('sku')
->addAttributeToSelect('name')
->addTagFilter($tagId);
print_r($collection->getData());
there are two way to put limit on collection.
$tagId = 1; // I want to get id on view.html
$collection = Mage::getResourceModel('tag/product_collection')
->addAttributeToSelect('sku')
->addAttributeToSelect('name')
->addTagFilter($tagId)
->setPageSize(8);
or
$collection = Mage::getResourceModel('tag/product_collection')
->addAttributeToSelect('sku')
->addAttributeToSelect('name')
->addTagFilter($tagId);
$collection->getSelect()->limit(8);
I think you're after addProductFilter
from Mage_Tag_Model_Entity_Customer_Collection
$model = Mage::getModel('tag/tag')->getCollection()
->addProductFilter($ProductId)
->setFlag('relation', true)
->addStoreFilter(Mage::app()->getStore()->getId())
->setActiveFilter();