Search Orders on CouponCode

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
hamidkm
Ensign (ENS)
Ensign (ENS)
Posts: 3
Joined: Thu Feb 11, 2010 2:25 am

Search Orders on CouponCode

Post by hamidkm » Thu Feb 25, 2010 4:04 pm

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.

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

Re: Search Orders on CouponCode

Post by mazhar » Fri Feb 26, 2010 9:29 am

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

hamidkm
Ensign (ENS)
Ensign (ENS)
Posts: 3
Joined: Thu Feb 11, 2010 2:25 am

Re: Search Orders on CouponCode

Post by hamidkm » Fri Feb 26, 2010 1:09 pm

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

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

Re: Search Orders on CouponCode

Post by mazhar » Tue Mar 02, 2010 7:39 am

I guess that may work. You can give it a try.

Post Reply