Extract Products by Category

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
FmaAlbee
Lieutenant (LT)
Lieutenant (LT)
Posts: 51
Joined: Fri Sep 12, 2008 2:12 pm

Extract Products by Category

Post by FmaAlbee » Fri Oct 31, 2008 2:45 pm

Is there a way to use the Ablecommerce API to build the code we need to extract the items for the various categories that need to be displayed on the new FMA site. For instance, our Program and Event site would call the page on the store site to extract the all bookstore items tagged with keyword COIL for instance and pass back a result set, which the FMA site would read and present to the user.

We currently use this coldfusion code to pull our products in our old store from a db to be displayed randomly

<cfquery name="GetRandomItem" datasource="FCData">
SELECT Name, Product_ID, Sm_Image
FROM Products
WHERE Product_ID = #ListGetRandom(RecordList)#
</cfquery>

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

Re: Extract Products by Category

Post by mazhar » Tue Nov 04, 2008 4:37 am

Yes this is possible. You can either use the LoadForCriteria function of product data source or can execute your own query to get the desired information. Read the following WIKI topic for custom queries.
http://wiki.ablecommerce.com/index.php/Custom_Queries

Most probably you will need to create a new ConLib control to accomplish this. You can then put this newly created control on store pages like any other ConLib control to show you information. Have a look at the following posts. These free controls are a good example for creating some custom query based control. Most probably you will just need to change the SQL query part.
viewtopic.php?f=47&t=6984
viewtopic.php?f=47&t=6886

FmaAlbee
Lieutenant (LT)
Lieutenant (LT)
Posts: 51
Joined: Fri Sep 12, 2008 2:12 pm

Re: Extract Products by Category

Post by FmaAlbee » Tue Nov 04, 2008 11:13 am

Thank you for the information Mazhar! :D

Post Reply