How to Reset the Products Viewed Report
In the administration area under Reports, you will find a list of products and the number of times they have been viewed.
If you are have been developing your site, then chances are most of these views will be from you. To rest all the values to zero, here’s what to do.
Remember to backup your database before doing this, just in case.
The Basics
Open the application you use to run SQL queries on your database. I use PHPMyAdmin. Run the following SQL command.
-
UPDATE products_description SET products_viewed = 0
Open the products viewed report in your osCommerce admin area. If successful, all the product view counts will have been reset to 0.
Digging Deeper
The products_description table in the database holds the product’s name, description, view count and URL for each of the core languages. By running the command above, all the products_viewed entries in each row of the table are set to 0.
If you wanted to reset a specific product’s view count, then you could use one of the following commands.
-
# Reset view count by product name
-
UPDATE products_description SET products_viewed = 0 WHERE products_name = ‘My Product’;
-
# Reset view count by product id
-
UPDATE products_description SET products_viewed = 0 WHERE products_id = 1;
Remember to insert the name of your product in the first command, and the product id in the second.
Enjoyed reading this post? Get more delivered directly to you.
Hi,
I have reset the products viewed to ‘0′, however i want to display more than 4 products per page.
How can this be done?
Thanks
John | July 31st, 2007 at 4:29 am
The above command resets the osCommerce products viewed counter that can be seen in the admin screens.
I don’t understand what you mean when you say ‘display more than 4 products per page’. Which page do you mean? The product listings in the catalog?
Ed | July 31st, 2007 at 6:19 am
I am refering to when you login to oscommerce as an admin and then click on the ‘Reports’ option. The are 3 option provided i)Products Viewed ii)Products Purchased iii)Customers Orders-Total.
Clicking on each of these will only display 4 items each page. I want it to display 10 items per page.
Thanks
John | August 3rd, 2007 at 12:31 am
Go into admin -> Configuration -> Maximum Values and look for the ‘Search Results’ value. I believe this value limits the number of search results shown, but also the number of rows shown in reports. Is yours set to 4 by any chance?
If you want to increase the number of items in your reports, you can (a) increase this number (which my affect your stores search page) or (b) hack it with the following (not the ideal solution but just in case you need it):
1. Open catalog/admin/stats_products_viewed.php.
2. On line 56 and 59, replace 3 occurences of MAX_DISPLAY_SEARCH_RESULTS with n (where n is the number of items to show).
WARNING: I have not tested this and am doing it from memory, so please backup your files first!
Ed | August 3rd, 2007 at 8:58 am
Thanks!
Thats exactly what i was after
John | August 9th, 2007 at 10:26 am