[ic] most viewed items report

Michael Goldfarb interchange-users@icdevgroup.org
Mon Nov 18 19:03:00 2002


>
>    Anyone out there have any additional reports for IC that they want
to
>share with the crowd?  I was considering doing a "most viewed products"
>report but then realized I might be reinventing the wheel.
>
>Jeff
>

I have done this with a simple update query on flypage that only
requires adding a column to the products table called "number_accessed"
and setting the default value to 0. Once that column has been created, I
just add this query to flypage.html:

[query st=db sql="update products 
set number_accessed = '[calc][item-field number_accessed] + 1[/calc]'
where sku = '[item-code]'
"]
[/query]

Then I just create a component modeled after "best" (which is part of
foundation) to display the most viewed items throughout the site. The
only difference in the new component compared to "best" is that it
obviously queries number_accessed in the products table instead of
times_ordered in the merchandising table.

This seems to work out well for our clients and is relatively low
overhead.

I have also added a column in the UI on the Items page where clients can
view/sort by the number of times each item was accessed pulling values
from the same "number_accessed" column.

Hope this helps.