Getting popular products by category
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 32
- Joined: Mon Jan 28, 2008 10:05 am
Getting popular products by category
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.
Any ideas?
Thanks,
Dave.
- m_plugables
- Commander (CMDR)
- Posts: 149
- Joined: Tue Mar 11, 2008 12:44 am
- Contact:
Re: Getting popular products by category
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
http://wiki.ablecommerce.com/index.php/ ... uilder_API as refarnce that how to write your database related custom code
Visit the links below to Download Plugins for your AC7 Store
http://www.plugables.com
http://blog.plugables.com
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 28
- Joined: Wed Jun 04, 2008 1:45 am
Re: Getting popular products by category
i thought this would be an easy modification to the current featuredgrid control ?
- m_plugables
- Commander (CMDR)
- Posts: 149
- Joined: Tue Mar 11, 2008 12:44 am
- Contact:
Re: Getting popular products by category
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()
Visit the links below to Download Plugins for your AC7 Store
http://www.plugables.com
http://blog.plugables.com
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 32
- Joined: Mon Jan 28, 2008 10:05 am
Re: Getting popular products by category
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
Thanks,
Dave
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 32
- Joined: Mon Jan 28, 2008 10:05 am
Re: Getting popular products by category
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
- m_plugables
- Commander (CMDR)
- Posts: 149
- Joined: Tue Mar 11, 2008 12:44 am
- Contact:
Re: Getting popular products by category
Thanks for sharing your experience dave
Visit the links below to Download Plugins for your AC7 Store
http://www.plugables.com
http://blog.plugables.com