Order of Ratings/Reviews

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
User avatar
troutlet
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Sep 24, 2007 3:01 am
Location: USA
Contact:

Order of Ratings/Reviews

Post by troutlet » Fri Feb 29, 2008 10:42 am

Currently when a new Review is posted it goes on the end of the list. I think that it should go at the front of the list (most recent reviews first) but have not been able to find out how to make the change. Any advice?

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

Post by jmestep » Fri Feb 29, 2008 4:25 pm

I do see in the new API help file that there is sort parameter, but I haven't found how to implement it yet.
public static ProductReviewCollection LoadForProduct(
int productId,
int maximumRows,
int startRowIndex,
string sortExpression
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

User avatar
troutlet
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Sep 24, 2007 3:01 am
Location: USA
Contact:

clue

Post by troutlet » Fri Feb 29, 2008 4:34 pm

Thanks Judy, that's a good clue.

I'm tempted to report it as a bug. It seems that all sites with reviews list them with the newest one first.

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 Feb 29, 2008 5:20 pm

Using the method Judy detailed above, you would populate the other parameters as required and set the sort parameter to

Code: Select all

"ReviewDate DESC"
That will force the returned collection set to be sorted by the date of the review in newest-to-oldest sequence.
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
troutlet
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Sep 24, 2007 3:01 am
Location: USA
Contact:

Still unclear

Post by troutlet » Sat Mar 01, 2008 9:17 am

Thanks but I'm still unclear on how to do that. Do you mean to add this as part of the [[ConLib:ProductReviewsPanel]] string? or is this to go in the .cs file or something else?

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 01, 2008 9:42 am

Sorry, I jumped in late in the thread and just posted on what Judy was talking about.

The productreviewspanel user control uses an ObjectDataSource control to bring in the review records for display. This is on the HTML side, not the code side.
I can see it has a parameter for the "SortExpression", but I'm not sure how to modify it. It looks like it's part of one of the Able classes and I don't have the full source code.
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
troutlet
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Sep 24, 2007 3:01 am
Location: USA
Contact:

looking

Post by troutlet » Sat Mar 01, 2008 9:52 am

I just appreciate you looking into it at all.

I see the line:
<asp>

I tried changing that to Review Date but it had no affect at all, which I found strange. I expected it to break or something.

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 01, 2008 10:05 am

repost that last message with HTML turned off -the code didn't come through.
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
troutlet
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Sep 24, 2007 3:01 am
Location: USA
Contact:

ooops

Post by troutlet » Sat Mar 01, 2008 10:10 am

Code: Select all

<asp:TemplateField HeaderText="Rating" SortExpression="Rating">
I tried changing that to SortExpression="ReviewDate" but it had no affect at all, which I found strange. I expected it to break or something.

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 01, 2008 11:42 am

I'm not sure either.
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
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 » Sat Mar 01, 2008 11:52 am

Hello All,

I've added a bug report to show newest first. Don't see any reason such a minor change won't make it into our next release...
Thanks for your support

Shopping Cart Guru
AbleCommerce.com
Follow us on Facebook

User avatar
troutlet
Lieutenant (LT)
Lieutenant (LT)
Posts: 77
Joined: Mon Sep 24, 2007 3:01 am
Location: USA
Contact:

Thanks

Post by troutlet » Sun Mar 02, 2008 3:59 pm

Thanks Mike, that is very appreciated. :D

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

Post by jmestep » Mon Mar 03, 2008 7:24 am

I got part of the way there when I tried replacing the <asp:GridView in ProductReviewsPanel.ascx with cb:SortedGridView, like the admin/ProductReviews/Default.aspx has, but I've got to work on something else.
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

User avatar
sohaib
Developer
Developer
Posts: 1079
Joined: Fri Jan 23, 2004 1:38 am

Post by sohaib » Mon Mar 03, 2008 9:22 am

The default asp Grid View component is not friendly enough to let you pass the default sort expression for the first time you load the grid.

We have a custom control written for this purpose.

To get the problem fixed, replace GridView with SortedGridView in in ProductReviewsPanel.ascx.

Previous code

Code: Select all

<asp:GridView ID="ReviewsGrid" runat="server" DataSourceID="ReviewDs" AutoGenerateColumns="False" 
                            ShowHeader="false" AllowPaging="True" PageSize="4" SkinID="PagedList" CellPadding="4" CellSpacing="0" Width="100%">
New code

Code: Select all

 <cb:SortedGridView ID="ReviewsGrid" runat="server" DataSourceID="ReviewDs" AutoGenerateColumns="False" 
                            ShowHeader="false" AllowPaging="True" PageSize="4" SkinID="PagedList" CellPadding="4" CellSpacing="0" Width="100%" DefaultSortExpression="ReviewDate"  DefaultSortDirection="Descending" >

Note: Don't forget to include SortedGridView

Code: Select all

<%@ Register Assembly="CommerceBuilder.Web" Namespace="CommerceBuilder.Web.UI.WebControls" TagPrefix="cb" %>

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

Post by jmestep » Mon Mar 03, 2008 10:26 am

The above is as far as I got with it, when I made those changes, I got the error on the page:
[[ConLib:ProductReviewsPanel]] Type 'CommerceBuilder.Web.UI.WebControls.SortedGridView' does not have a public property named 'ObjectDataSource'

but haven't had time to find out why. Do you get that error?
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

User avatar
satori
Lieutenant (LT)
Lieutenant (LT)
Posts: 64
Joined: Mon Jun 26, 2006 1:04 am
Location: Colorado Rockies above Boulder
Contact:

Post by satori » Sun Mar 09, 2008 7:22 pm

Yes, Judy, I get that same error. I guess I'll wait until the next release.

User avatar
sohaib
Developer
Developer
Posts: 1079
Joined: Fri Jan 23, 2004 1:38 am

Post by sohaib » Tue Mar 11, 2008 11:05 am

Well I copied and pasted the code from the latest file after fixing the bug. These are the only changes that were made.

I am not sure why you are getting this error. I hope you remembered to include

Code: Select all

<%@ Register Assembly="CommerceBuilder.Web" Namespace="CommerceBuilder.Web.UI.WebControls" TagPrefix="cb" %>

User avatar
satori
Lieutenant (LT)
Lieutenant (LT)
Posts: 64
Joined: Mon Jun 26, 2006 1:04 am
Location: Colorado Rockies above Boulder
Contact:

Post by satori » Tue Mar 11, 2008 12:36 pm

Yes, I remembered to include that, but I still got the same error.

User avatar
sohaib
Developer
Developer
Posts: 1079
Joined: Fri Jan 23, 2004 1:38 am

Post by sohaib » Wed Mar 12, 2008 10:56 am

Very strange I must say. The SortedGridView control is extending the normal GridView control. I can't see any reason why it should give an error like ..."does not have a public property named 'ObjectDataSource' "

I never reproduced it but may be there is something that I am missing.

Post Reply