
Originally Posted by
stampsville
Hi all,
In the admin side I can see the list of item views count.
Is there a way to display that in the product_info page?
This product has been viewed...
Thanks
Grant
Yes i want that too.
I onlle managed to show the most viewed product count number, not the exact views of every separate product.
What have i done:
In /includes/modules/pages/product_info/main_template_vars.php right before
PHP Code:
$products_model = $product_info->fields['products_model'];
// if no common markup tags in description, add line breaks for readability:
$products_description = (!preg_match('/(<br|<p|<div|<dd|<li|<span)/i', $product_info->fields['products_description']) ? nl2br($product_info->fields['products_description']) : $product_info->fields['products_description']);
i put that:
PHP Code:
$products_query_raw = "select p.products_id, pd.products_name, pd.products_viewed, l.name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_LANGUAGES . " l where p.products_id = pd.products_id and l.languages_id = pd.language_id order by pd.products_viewed DESC";
$products = $db->Execute($products_query_raw);
and somewhere in product info page exactly were i wanted to apear in my case under product image
PHP Code:
<?php echo $products->fields['products_viewed']; ?>
But that gives me only the most watched product count.
Can someone help ?