Getting popular products by category

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
dave_reach
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 32
Joined: Mon Jan 28, 2008 10:05 am

Getting popular products by category

Post by dave_reach » Mon Jul 07, 2008 4:36 am

Is there a simple way using the AbleCommerce API to return the top selling products from a specified category? I have a category called Bundles, and I need to list the Top Bundles.

Any ideas?

Thanks,
Dave.

User avatar
m_plugables
Commander (CMDR)
Commander (CMDR)
Posts: 149
Joined: Tue Mar 11, 2008 12:44 am
Contact:

Re: Getting popular products by category

Post by m_plugables » Mon Jul 07, 2008 5:21 am

You may have to write some custom database related code for this purpose. You can use this
http://wiki.ablecommerce.com/index.php/ ... uilder_API as refarnce that how to write your database related custom code
Image
Visit the links below to Download Plugins for your AC7 Store
http://www.plugables.com
http://blog.plugables.com

sacards.com
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 28
Joined: Wed Jun 04, 2008 1:45 am

Re: Getting popular products by category

Post by sacards.com » Mon Jul 07, 2008 8:19 pm

i thought this would be an easy modification to the current featuredgrid control ?

User avatar
m_plugables
Commander (CMDR)
Commander (CMDR)
Posts: 149
Joined: Tue Mar 11, 2008 12:44 am
Contact:

Re: Getting popular products by category

Post by m_plugables » Tue Jul 08, 2008 1:39 am

In fact ProductDataSource class have no functions that finds the popular products for some specific category. Yes you can use the current Featured Products grid control because it has most of the things like the layout etc. You just need to write some custom function in the control which returns the popular products for your criteria and then use this function instead of ProductDataSource.GetPopularProducts()
Image
Visit the links below to Download Plugins for your AC7 Store
http://www.plugables.com
http://blog.plugables.com

dave_reach
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 32
Joined: Mon Jan 28, 2008 10:05 am

Re: Getting popular products by category

Post by dave_reach » Wed Jul 09, 2008 2:52 am

That is what i'll do - i've already written a myriad of custom database code to select a variety of different things, i'm just struggling to work out how to order by sales - although I havn't really had a proper look yet - that is this morning's job!

Thanks,
Dave

dave_reach
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 32
Joined: Mon Jan 28, 2008 10:05 am

Re: Getting popular products by category

Post by dave_reach » Wed Jul 09, 2008 3:15 am

For anyone who is interested this is how I achieved this, although it has altered since my original request. The client now wishes to set Bundles as an option on the product, so I created a Template Field to hold this information.

Code: Select all

SELECT TOP 3 ac_Products.ProductId, ac_ProductTemplateFields.ProductId FROM ac_ProductTemplateFields
INNER JOIN ac_Products ON (ac_Products.ProductId = ac_ProductTemplateFields.ProductId)
WHERE (ac_ProductTemplateFields.InputFieldId = 2 AND ac_ProductTemplateFields.InputValue = 1)
ORDER BY (SELECT SUM(Quantity) FROM ac_OrderItems WHERE ac_OrderItems.ProductId = ac_Products.ProductId) DESC

User avatar
m_plugables
Commander (CMDR)
Commander (CMDR)
Posts: 149
Joined: Tue Mar 11, 2008 12:44 am
Contact:

Re: Getting popular products by category

Post by m_plugables » Wed Jul 09, 2008 3:30 am

Thanks for sharing your experience dave
Image
Visit the links below to Download Plugins for your AC7 Store
http://www.plugables.com
http://blog.plugables.com

Post Reply