Order of Ratings/Reviews
Order of Ratings/Reviews
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?
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
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
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
clue
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.
I'm tempted to report it as a bug. It seems that all sites with reviews list them with the newest one first.
Using the method Judy detailed above, you would populate the other parameters as required and set the sort parameter to
That will force the returned collection set to be sorted by the date of the review in newest-to-oldest sequence.
Code: Select all
"ReviewDate DESC"
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
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
Still unclear
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?
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.
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
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
looking
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.
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.
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
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
ooops
Code: Select all
<asp:TemplateField HeaderText="Rating" SortExpression="Rating">
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
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
- Shopping Cart Admin
- AbleCommerce Admin
- Posts: 3055
- Joined: Mon Dec 01, 2003 8:41 pm
- Location: Vancouver, WA
- Contact:
Thanks
Thanks Mike, that is very appreciated. 

- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
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
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
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
New code
Note: Don't forget to include SortedGridView
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%">
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" %>
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
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?
[[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
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
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
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" %>