Post by hoze » Thu Jun 06, 2013 3:28 am

Hello.
First of all, sorry for my bad english :-\ . Now...I was searching the way how to display in FRONT on product page the number of views for each product(somehting like in admin/report/product/viewed) . With little research,help & idea from this community forum(major idea and help came from this topic http://forum.opencart.com/viewtopic.php?f=121&t=27767 ), I will try to share my solution with you.

1.) in catalog/view/theme/default/template/product/product.tpl
FIND:

Code: Select all

<?php echo $stock; ?>

after add:

Code: Select all

<span><?php echo $text_viewed; ?></span> <?php echo $viewed; ?><br />
2.) in catalog/controller/product/product.php

FIND:

Code: Select all

$this->data['text_price'] = $this->language->get('text_price');
after add this:

Code: Select all

$this->data['text_viewed'] = $this->language->get('text_viewed');
(in this file) after:
FIND:

Code: Select all

$this->data['model'] = $product_info['model'];
after add:

Code: Select all

$this->data['viewed'] = $product_info['viewed'];
3.) In your file localization: catalog/language/YOUR_LANGUAGE/product/product.php

add this:

Code: Select all

$_['text_viewed']         = 'Views:';

...if everything is OK now on product page,after "Model", you can see how much times was viewed that product. You can see live in my store http://www.mobilnimarket.com .
I hope this will be helpfull to someone ;D Tested od OC 1.5.1!

All the best, Hoze
P.S. Vqmod version of file available too for download.

Attachments

vqmod version

number of views.png

sample - number of views.png (50.12 KiB) Viewed 2688 times


http://www.winaliteserbia.com My OC Shop's http://www.mobilnimarket.com http://www.novimobilnitelefoni.com


New member

Posts

Joined
Sun Aug 28, 2011 11:23 pm
Location - Serbia

Post by tonytoan » Wed Jun 26, 2013 4:39 pm

i have version 1.5.3.1 i try and test out but nuthing show up

New member

Posts

Joined
Thu May 05, 2011 8:27 am
Who is online

Users browsing this forum: No registered users and 4 guests