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

Notification

Icon
Error

blueacorn
#1 Posted : Saturday, August 11, 2007 4:53:49 PM(UTC)
blueacorn

Rank: Member

Joined: 6/27/2007(UTC)
Posts: 63

Any suggestions on how to create a dynamically generated on Sale category based on the products on sale? Doesn't look possible in the admin pages - looking at the db there's a field that stores XML data for the criteria of those dynamic categories, is there a Criteria column with some xml formatted criteria. Are you using any kind of xml querying language that I can use to create a custom query (like fetchXML)? It would be a great feature to have a dynamic category that allows you to specify your own criteria, even a SQL query that just returns the productIDs to be used in the category...
jwilliams
#2 Posted : Wednesday, August 22, 2007 9:08:17 PM(UTC)
jwilliams

Rank: Member

Joined: 4/6/2006(UTC)
Posts: 27

I am also interested to know if this is possible. This would be incredibly helpful on both ends. Customers will easily be able to see what items are on sale and admins will only have to manage what items are on sale and not have to worry about adding and deleting products from a sale item category as sales come and go.
blueacorn
#3 Posted : Wednesday, August 22, 2007 10:04:33 PM(UTC)
blueacorn

Rank: Member

Joined: 6/27/2007(UTC)
Posts: 63

I was able to create a dynamic category for browsing "by size". I was able to do this by editing the source of the core BV project in a few places, and whenever a certain category is used, I call my own stored procedure to fetch the items I want. For the stored proc, I just took an existing one and modified the query to pull in the data I needed. Now, the logic for by size wasn't easy, it involved joins across about 5 tables in all. For the dynamic on sale category - haven't gotten there yet, but I'll use the same method and create my own stored proc to get the items that are on sale - and recalling the db structure offhand I believe there are a few tables involved here that will need separate logic, one table has sales by category, other is sale by items, etc. so all of them will have to be unioned together.

If you have the dev version you should be able to figure it out - if not, the only other option is if there's some kind of behind the scenes query we can use besides what's offered to us on the interface for dynamic categories. Good luck!
jwilliams
#4 Posted : Thursday, September 6, 2007 6:43:05 PM(UTC)
jwilliams

Rank: Member

Joined: 4/6/2006(UTC)
Posts: 27

I have somewhat created this effect without modifying source code. I added in a "Sale Items" list item into the Sort By dropdown in the ProductFilter.ascx control. Then in the [color=#ffffcc>

[tr ][td ]<CODE>
Line]Line 70: Dim sw As New IO.StringWriter()
<FONT color=red>Line 71: xs.Serialize(sw, criteria)
[/color]Line 72: Try
Line 73: category.Criteria = sw.ToString()</PRE>[/code][/td][/tr]</TABLE>
<B>[color=#ffffcc>

[tr ][td ]<CODE>
[InvalidOperationException:] Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterProductSearchCriteria.Write4_ProductSearchCriteriaSortBy(ProductSearchCriteriaSortBy v) +145
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterProductSearchCriteria.Write9_ProductSearchCriteria(String n, String ns, ProductSearchCriteria o, Boolean isNullable, Boolean needType) +691
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterProductSearchCriteria.Write10_ProductSearchCriteria(Object o) +102

[InvalidOperationException: There was an error generating the XML document.] System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) +674
System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o) +64
BVAdmin_Catalog_Categories_AutomaticSelection.SaveChangesImageButton_Click(Object sender, ImageClickEventArgs e) in c:\inetpub\wwwroot\SP2_ShoppingCart\BVAdmin\Catalog\Categories_AutomaticSelection.aspx.vb:71
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +105
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
</PRE>[/code][/td][/tr]</TABLE>[/color]



Obviously the new Sort By value that I added into the ProductFiler.ascx control is causing the error but I'm not sure how to fix this. I put in some code to change the SortBy value to an appropriate one before xs.Serialize(sw, criteria) is called which allows the save and the category is populated with the appropriate products. However I think this will not be acceptable for auto-generation of the dynamic category because the SortBy value is being saved as something other than "Sale Items". If anyone has insight on how I could pass the new SortBy value this would be a great help to me.
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.

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