• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

jorgem
#1 Posted : Saturday, November 4, 2006 7:49:56 PM(UTC)
jorgem

Rank: Member

Joined: 10/17/2006(UTC)
Posts: 66

I have made a custom category template -- a modified version of the Bulk Order List.

There is one feature I'd like to add: I want to sort (and possibly group) the items in the bulk order list. Any suggestions on how to do this?
jorgem
#2 Posted : Saturday, November 4, 2006 9:11:17 PM(UTC)
jorgem

Rank: Member

Joined: 10/17/2006(UTC)
Posts: 66

For what it's worth, this code will sort alphabetically, which is better than nothing (replace the existing code):

Code:

Public Sub LoadProducts()

Dim criteria As New Catalog.ProductSearchCriteria()
criteria.CategoryId = Request.QueryString("CategoryID")
criteria.SortBy = Catalog.ProductSearchCriteriaSortBy.ProductName
criteria.SortOrder = Catalog.ProductSearchCriteriaSortOrder.Ascending
Dim displayProducts As Collection(Of Catalog.Product) = Catalog.InternalProduct.FindByCriteria(criteria)

Me.DataList1.DataSource = displayProducts
Me.DataList1.DataBind()

If displayProducts.Count < 1 Then
Me.btnAddToCart.Visible = False
Else
Me.btnAddToCart.Visible = True
End If

End Sub
jetheredge
#3 Posted : Monday, November 6, 2006 4:25:48 PM(UTC)
jetheredge

Rank: Member

Joined: 3/1/2006(UTC)
Posts: 1,142

Well, the ProductSearchCriteriaSortBy enumeration provides a bit of flexibility in terms of sorting by ProductName, MfgName, CreationDate, SitePrice, and Vendor. Since we do all of the code in stored procedures, we have to manually account for each of these, which is why you can't just sort on any column. Is there any columns in particular that would be of use to you?
Justin Etheredge
Senior Software Engineer
BVSoftware
jorgem
#4 Posted : Monday, November 13, 2006 3:16:59 PM(UTC)
jorgem

Rank: Member

Joined: 10/17/2006(UTC)
Posts: 66

I wanted to sort on one of my custom property types.
scott.mech
#5 Posted : Monday, November 20, 2006 3:56:05 PM(UTC)
scott.mech

Rank: Member

Joined: 4/4/2004(UTC)
Posts: 670

Justin,

this problem made it to bvc5? so if i put an item on sale, sort by price no longer functions correctly?

Scott Mech
jetheredge
#6 Posted : Wednesday, November 22, 2006 12:15:34 AM(UTC)
jetheredge

Rank: Member

Joined: 3/1/2006(UTC)
Posts: 1,142

Yes, the sales are applied after the product is pulled from the database. We only return the amount needed to show a particular page. In order to have pricing work with a sale, we would theoretically have to run the sale on every product in the query we are pulling out and then sort them accordingly, and then return this to the user. This could have severe effects on performance. The only other option would be to actually modify the price of a product in the product table when it is on sale, but this would be a nightmare to keep track of and to maintain.
Justin Etheredge
Senior Software Engineer
BVSoftware
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012