Posts Tagged ‘add discounts’
Commerce server 2007 provides business users to develop six different type of discounts. They are
- Simple Discount
- Minimum purchase discount
- Buy N, Get 1 free
- Paired discount
- Paired set discount
- Order discount
There are some cases where you want to associate a dynamic discount to an Order. In commerce server we have two ways to associate a discount to an order
- When a customer provides a promotion code.
- When a site wide discount is available.
If your requirement is to associate a discount to an order (like 10% off or 20$ off), use following approach to achieve this.
- In code behind, create a discount.
- Add a promotion code to a discount.
- Approve the discount. Note: If you are using discount cache, make sure you call refreshCache method.
- Create a basket and associate the promotion code and perform checkout process.
- Disapprove newly added discount.
- Delete newly added discount.
Here I am not given end to end solution, but throwing some light on the approach. If you feel it is difficult to to know which method to call for which action, you can refer to my blog – http://ravikk.spaces.live.com/blog/cns!F348D7145D1BE6C2!500.entry which explains how to know which commerce server method to call.
If you want to try before you implement in your code, you can refer to quick order code in my blog – it is having code which performs entire checkout at single action (you need to extend it by adding discount creation and deletion code). http://ravikk.spaces.live.com/blog/cns!F348D7145D1BE6C2!428.entry
If you like this post, please click on our sponsor advertisement.
