Recently Viewed Products Control is not working correctly

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
ayilmaz
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Thu Jan 03, 2008 4:37 pm

Recently Viewed Products Control is not working correctly

Post by ayilmaz » Fri Mar 14, 2008 11:42 am

Hi,
I have added the Recently Viewed Products control which is ConLib/RecentlyViewd.ascx. However the very recent product that I viewed shows up at the very bottom of the list not at the top. In the code behind the call to the datasource:

PageViewDataSource.GetRecentlyViewedProducts(userId, this.MaxItems, 0, "ActivityDate DESC")

is supposedly sorting the results descending by ActivityDate. I checked the database, the activity dates are being updated as pages are viewed however the last viewed page is showing up at the bottom.

Does this control work properly? Is anyone using it?

Thanks,
Ayilmaz

User avatar
Shopping Cart Admin
AbleCommerce Admin
AbleCommerce Admin
Posts: 3055
Joined: Mon Dec 01, 2003 8:41 pm
Location: Vancouver, WA
Contact:

Post by Shopping Cart Admin » Fri Mar 14, 2008 11:59 am

Hello,

It's working just fine in my testing. Newest ones are showing up first in the list.

viewtopic.php?t=6073
Thanks for your support

Shopping Cart Guru
AbleCommerce.com
Follow us on Facebook

ayilmaz
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Thu Jan 03, 2008 4:37 pm

Post by ayilmaz » Fri Mar 14, 2008 12:31 pm

I did not change any code in this control. I did not change the backend. How come it is not working?

My site's url is http://www.candlesandhomedecor.com
Would you like to see it yourself? Just click on a product and then click on a category link.

Any ideas? It is really bizarre...

Thanks,
Aylin

ayilmaz
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Thu Jan 03, 2008 4:37 pm

Post by ayilmaz » Fri Mar 14, 2008 3:07 pm

Hi Mike,
Did you get a chance to look at the website? Do you have any ideas, recommendations?
Thanks a lot,
Aylin

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Post by jmestep » Fri Mar 14, 2008 5:03 pm

I looked at it and I guess you're going to have to stand on your head to see the most recent one first. :D
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

ayilmaz
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Thu Jan 03, 2008 4:37 pm

Post by ayilmaz » Fri Mar 14, 2008 8:33 pm

Thanks Judy :)

I ran the Sql Server Profiler to see the queries running, here is the query to get the top 5 products from ac_pageviews table.


SELECT DISTINCT TOP 5 CatalogNodeId, CatalogNodeTypeId FROM ( SELECT TOP 15
PageViewId,StoreId,ActivityDate,RemoteIP,RequestMethod,UserId,UriStem,UriQuery,TimeTaken,UserAgent,Referrer,CatalogNodeId,CatalogNodeTypeId,Browser,BrowserName,BrowserPlatform,BrowserVersion,AffiliateId FROM ac_PageViews WHERE StoreId
= 1 AND CatalogNodeTypeId = 1 AND UserId = 2 ORDER BY ActivityDate DESC ) ac_PageViews_1

Now, the inner query returns the correct order

Inner query:

SELECT TOP 15
PageViewId,StoreId,ActivityDate,RemoteIP,RequestMethod,UserId,UriStem,UriQuery,TimeTaken,UserAgent,Referrer,CatalogNodeId,CatalogNodeTypeId,Browser,BrowserName,BrowserPlatform,BrowserVersion,AffiliateId FROM ac_PageViews WHERE StoreId
= 1 AND CatalogNodeTypeId = 1 AND UserId = 2 ORDER BY ActivityDate DESC

However when the results are selected again using the outer query "SELECT DISTINCT TOP 5 CatalogNodeId, CatalogNodeTypeId FROM.. "
The order gets messed up.

The PROBLEM is that the outer query causes the results the be sorted by catalogNodeId.

I did not insert any data manually. I don't know why this is not working.

Why do we need the outer query?

Thanks,
Aylin

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Fri Mar 14, 2008 11:00 pm

Mine's never worked like I expected it should, so I pulled it long ago from my site.

From a technical standpoint, the queries are valid. 15 records based on pageview count are selected and returned in ascending order by activitydate. Then the top 5 of the most recent 15 records are returned.

The reasonable assumption (you, me and most everyone else) is the returned dataset will be actually be sorted in order of most recent first, which obviously it isn't. But the query is showing the top 5 most recently viewed records, it's just not sorting those final 5 records in order of recent-ness.

I agree the query seems unusually inefficient - especially for a control likely placed in a common area like a sidebar that'll get rendered on most every page hit to the site.

I suggest you post an Able support ticket with your profiler results and comments from your post - that'll give them the information they need to fix it. Nicely done with the profiler, I need to start using that more myself.

Oh and yes, recent-ness is a word. It's my word. Mine I tell you :wink:
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

ayilmaz
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Thu Jan 03, 2008 4:37 pm

Post by ayilmaz » Sat Mar 15, 2008 1:30 am

Thanks for the comment. I am glad to hear I am not the only one. I just submitted a ticket.

ayilmaz
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Thu Jan 03, 2008 4:37 pm

Post by ayilmaz » Sat Mar 15, 2008 1:36 am

Hey Joe,
BTW, I have checked out your website and have been reading your comments. First of all thanks a lot for all the contribution, they have been extremely helpful. I noticed that you have a live chat option on your webpage. How did you do that and is there an affiliate program that you are using? if you don't mind sharing.
Thanks,
Aylin

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Sat Mar 15, 2008 8:29 am

Thank you for the compliments :)

My livechat program is from Xigla.com. It works pretty well although I highly suggest NOT turning on the "real-time" feature as it absolutely slam your bandwidth. Otherwise, it worked incredibly well almost out of the box - like 10 minutes to integrate into AC7.

Only downside to Xigla.com stuff is the guy is *really* short with tech support responses in bad english. And he's a Javascript coder, so his ".Net" applications are just barely that - everything he does behind-the-scenes is java. His web site design is awesome but his programming is buggy. I hate code-behind in JS, especially when it's not documented well.

I've never used an affiliate program - not entirely sure what they do. I am using the Affiliates feature in AC7 to do some simplistic campaign tracking.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
bryancapitano
Ensign (ENS)
Ensign (ENS)
Posts: 13
Joined: Sun Oct 05, 2008 9:33 am
Location: Portland, Oregon
Contact:

Re: Recently Viewed Products Control is not working correctly

Post by bryancapitano » Sun Oct 05, 2008 9:49 am

Hi,

We'd like to enable this Recently Viewed module in an AbleCommerce store we're building. Can somebody tell me, where do we go to enable this module?

Thanks,

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Recently Viewed Products Control is not working correctly

Post by AbleMods » Sun Oct 05, 2008 10:13 am

AC7 includes a user control that provides the recently viewed functionality.

To add it to your site, simply edit a scriptlet (most people use a sidebar scriptlet) and add the line [[ConLib:RecentlyViewed]].

You can use the integrated ConLib Reference available on the Admin Help menu to see what parameters are available.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Post Reply