Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Products_Viewed number?

Products_Viewed number?

Locked

Views: 419

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
5 Dec 2010, 12:36 AM
#1
aspirer avatar

aspirer

New Zenner

Join Date:
Dec 2010
Posts:
2
Plugin Contributions:
0

Products_Viewed number?

Hello,

I searched over this measureless zen-cart website regarding an issue i am facing.

I want to display on product info page, the number that product has been viewed, i can see it in admin panel, but i want user to see it on front page of a product.

For example on index.php?main_page=product_info&cPath=2&products_id=262, the product is displayed with images and everything, and i want to include there the number it has been viewed like other websites have.

If i can assist you with any information, please don't hesitate to ask me.

Regards.

5 Dec 2010, 4:04 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Products_Viewed number?

In your templates and overrides file you could use the function zen_products_lookup to find the contents of any field based on the products_id ...

the function accepts 3 paramaters:

zen_products_lookup($product_id, $what_field = 'products_name', $language = '')

The products_id on the product _info page can be used with:
(int)$_GET['products_id']

the field in the products_description table is the:
products_viewed

the language can be sent if you do not want to use the current language, otherwise it will use the current language from:
$_SESSION['languages_id']

automatically in the function ...

echoing the function where you need it should give you the products_viewed ...