Page 1 of 1

Search Orders on CouponCode

Posted: Thu Feb 25, 2010 4:04 pm
by hamidkm
I need to change the Orders search interface in the admin tool and be able to filter Orders based on the Coupon Code.
Any Idea how I can implement this?
I tried adding extra filters to the OrderSearchCriteria Object, but didn't work.

Re: Search Orders on CouponCode

Posted: Fri Feb 26, 2010 9:29 am
by mazhar
I guess to accomplish this you would need a some custom query. Instead of modifying the order admin create a new page and then put some code to filter the orders for you where customer applied some specific coupon code. For example you can use
following query to filter the orders

Code: Select all

SELECT  DISTINCT * FROM 
ac_Orders AS O INNER JOIN ac_OrderItems AS OI
ON O.OrderId = OI.OrderId
WHERE OI.OrderItemTypeId = 5 AND OI.Sku ='coupon_code_here'

Have a look here to find how you can write custom queries in AbleCommerce
http://wiki.ablecommerce.com/index.php/ ... uilder_API

Re: Search Orders on CouponCode

Posted: Fri Feb 26, 2010 1:09 pm
by hamidkm
Thanks for the response.

How about doing some custom filtering in the DataSource, Selected event?
I mean removing the records from the datasource that don't have the coupon condition.
Would you suggest that? If yes, would you suggest using Linq or not.

Thanks

Re: Search Orders on CouponCode

Posted: Tue Mar 02, 2010 7:39 am
by mazhar
I guess that may work. You can give it a try.