Customizing Search Results for Make/Model criteria

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
Sean@WMS
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Tue Nov 20, 2007 8:23 pm
Location: NW California
Contact:

Customizing Search Results for Make/Model criteria

Post by Sean@WMS » Mon Jul 28, 2008 8:39 pm

Hello,

My client, Jose, has made a couple of posts on someone else's topic ( viewtopic.php?f=42&t=7746&p=32975 ), so I wanted to get his thread restarted here. Thanks to Mazhar and Judy for their posts on the prior topic.

I am new to AbleCommerce 7, and have only launched one store with it so far, but I really liking what I've seen; however, with the lack of developer documentation, I'm still poking around in the dark quite a bit when it comes to customizing the application.

What Jose, who sells automobile wheel accessories -- mainly hubcaps and center caps -- needs is to have the Advanced Search customized to include Make / Model / Year criteria within a certain category -- let's say Cat = Center Caps, Make = Jeep/AMC, Model = Cherokee, Yr = 1990 ( which would be good for me as I'm missing a center cap on my 1990 Jeep Cherokee :wink: ).

For the Make and Model, we'd use AJAX to cascade the Models from the parent Make. The Categories would just be a list of Cats/Subcats as the current UI has them, and the Year select would simply have "Any" as the default, and then list backwards from Year(Now()+1) to 1940.

The data for Makes & Models would be handled through lookup tables I'll add to the db ( Models would be associated with partent Makes, and products would be assigned to Models ); Years would similarly be handled through a lookup table with parent Models.

I think I'm all good on all of that. Here's my challenge, though . . . . I haven't yet found where I can customize the Advanced Search to include this new criteria -- Make / Model / Year -- into a query that would produce the record set for the search result.

Can anyone point me in the right direction for this part?
Sean Connors
Web Merchant Services
Supplying the services you need to succeed online
www.WMSmerchantservices.com

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

Re: Customizing Search Results for Make/Model criteria

Post by sohaib » Wed Jul 30, 2008 5:19 am

What you are looking for seems pretty much like a standard for auto parts stores. I believe you will need to do some customization as product templates alone may not solve your problem. Make/Model/Year is hierarchical data that you may need to keep in separate tables and associate it with products. Once selection of Make/Model/Year is made you could then retrieve products matching these values.

You will probably not want to customize the existing advanced search page ... rather you should write your own page because your requirements are too different to just fit into existing search page.

User avatar
Sean@WMS
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Tue Nov 20, 2007 8:23 pm
Location: NW California
Contact:

Re: Customizing Search Results for Make/Model criteria

Post by Sean@WMS » Thu Jul 31, 2008 11:01 am

Thanks sohaib,

We're on the same page with all of this, but what I'm fishing for here is a pointer on where I can find the search query used by the Advanced Search. I agree with you that I'd do better not to customize the Advanced Search itself, but rather create a custom version of it . . . but I'd like to follow as closely as possible to the stock Advanced Search, and so far I can't seem to find where this query is produced in the source code.
Sean Connors
Web Merchant Services
Supplying the services you need to succeed online
www.WMSmerchantservices.com

User avatar
Sean@WMS
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Tue Nov 20, 2007 8:23 pm
Location: NW California
Contact:

Re: Customizing Search Results for Make/Model criteria

Post by Sean@WMS » Thu Jul 31, 2008 8:10 pm

I'd like to refine my question further here, as so far everyone seems to be focused on the "easy" part, or what I might call the "front end" of this -- the use of AJAX and lookup tables, etc. for the Make/Model search criteria . . . . but that's not really what my question is about at all.

My question is really about how to add ANY extra criteria to a search query -- it could be, as another example, Category = Shirts|Pants|Shorts & Sex = Male|Female

Again, without the benefit of an API or documentation, I'm hunting around in the source code of an application I'm just getting my feet wet with, which seems mostly to be really well built and very flexible for customizations; however, I just can't seem to find where I can customize a query to add new parameters to return on a search results page. That is, somewhere in here is something like a query such as:

Code: Select all

SELECT * FROM TableA WHERE CiterionA = X
to oversimplify the case, as obviously there would be joins and complex building of the criteria.

I suspect it must be in one of the CommerceBuilder DLLs, but I don't know if there are any properties/methods I can employ, or if I'd need to modify one of these DLLs and recompile, or what.

I can definitely go and build a custom search interface and post it to my own custom processing page and accomplish what I'd want here, but there would be many disadvantages to doing it that way -- mostly, I'd just rather work as closely as possible to the core code and recycle as much of it as possible for a customization like this, rather than do it all from scratch and have it running rather along side of AbleCommerce rather than with AbleCommerce.

I hope this clarifies my question enough for someone to point me in the right direction, or maybe just tell me I'll have to go do the whole thing top to bottom from scratch outside of AC7.
Sean Connors
Web Merchant Services
Supplying the services you need to succeed online
www.WMSmerchantservices.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Customizing Search Results for Make/Model criteria

Post by mazhar » Fri Aug 01, 2008 7:09 am

You can use the LoadForCriteria mehod available with DataSource classes to support your custom criteria. Please have a look at the following post
viewtopic.php?f=42&t=7345

But as for as i think the queries required for your solution will be quite complex so LoadForCriteria may not help you out in some cases. So it would be better to build a custom search interface.
Please check the following link for DataAccessLayer
http://wiki.ablecommerce.com/index.php/ ... cess_Layer
I suspect it must be in one of the CommerceBuilder DLLs, but I don't know if there are any properties/methods I can employ, or if I'd need to modify one of these DLLs and recompile, or what.
Yes you are right its in side CommerceBuilder.DLL, but you can't edit this code because its not available. You can purchase code for CommerceBuilder.DLL if you really need it.... but I don't think you need source code to make your current project work.

User avatar
Sean@WMS
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Tue Nov 20, 2007 8:23 pm
Location: NW California
Contact:

Re: Customizing Search Results for Make/Model criteria

Post by Sean@WMS » Tue Aug 05, 2008 10:09 pm

Thanks, mazhar,

You got me pointed in the right direction, it looks like.

I need some time to digest all of the threads I've found from here and start developing a beta to test what I can do with these options within the application.

I'll post back with my results.
Sean Connors
Web Merchant Services
Supplying the services you need to succeed online
www.WMSmerchantservices.com

tmatheso
Ensign (ENS)
Ensign (ENS)
Posts: 4
Joined: Wed Sep 24, 2008 3:44 pm

Re: Customizing Search Results for Make/Model criteria

Post by tmatheso » Thu Sep 25, 2008 2:52 pm

Hi Sean,

I'm just wondering if you've come up with a solution or plan of attack. Regarding Advanced Search, I have a very similar need as you, but perhaps a bit less robust. I'd simply like to modify the Advanced Search to include a drop down to specify Vendor, and then of course have this incorporated into the query. I'd sure appreciate any tips you can share. I'm an ASP.NET programmer so changes to source are certainly within scope - though only after other "configuration" options are exhausted.

Much thanks!
Tim

Post Reply