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?
|
|
|
|
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
|
|
|
|
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 |
|
|
|
Rank: Member
Joined: 10/17/2006(UTC) Posts: 66
|
I wanted to sort on one of my custom property types.
|
|
|
|
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
|
|
|
|
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.