I have to write code for getting product count.it is working fine but i want to know where the count record comes?
public function getProductCount($id)
{
$prodData = $this->_prodCollection->addViewsCount()->getData();
if (count($prodData) > 0) {
foreach ($prodData as $product) {
if ($product['entity_id'] == $id) {
return (int) $product['views'];
}
}
}
return 0;
}