Tuesday, February 22, 2011

External/Custom promotions loader for WCS

This article is more relevant for 6.0, As I am not sure, how much Management center makes it easier to create promotions and how much effort does it take compared to Accelerator. I did work on some on POC for management center and found it relatively easier to accelerator.

Promotion engine is really powerful and Accelerator only has limited functionality exposed.In the past I have worked on loading new promotion types that are supported by promotion engine using loading via spreadsheets and also same approach can be used to load external promotions into WCS.

The promotions loader essentially has to put entries and XML into the following tables.
PX_PROMOTION
PX_GROUP
CLCDPROMO
CALCODE
CALCODEDSC
CATENCALCD --product promotions
CATGPCALCD--category promotions

It is still a maintenance struggle from what I have seen in production for a couple of years but the functionality is not that hard to implement and these promotions are visible in Accelerator and can be disabled or deleted but these could not be edited in Accelerator because they were for created for custom features that had no OOB Accelerator support.

4 comments:

  1. You can create promotional codes without discounts or amount?

    create promotional code to access minisites for example

    thank you very much

    ReplyDelete
  2. Hi Raj,I am new to wcs.trying to understand the concepts one by one.Could you please explain when exactly the promotion engine comes into picture during the order processing flow?

    ReplyDelete
  3. Promotion engine is invoked by OrderCalculateCmd. It has a few implementation classes most common one might be PromotionEngineOrderCalculateCmdImpl. It is invoked from when you add an item to cart, when you delete, update cart and there could be other scenarios such as merge cart too. The way it works using calculationUsageId, which is passed into the command. The same orderCalculateCmd is responsbile for calculation of discounts (-1), shipping (-2), sales tax (-3), shipping tax, (-4) coupons (-5), surcharge (-6), shipping adjustment (-7). Also you can have custom usageId's.

    ReplyDelete
  4. Thank You so much.that is very helpful. I have one more question.does that mean that when we create any new promotions, OOB internally allocates a calculationUsageId to it so that it can use calculationUsageIds when calculating the discounts on shipping or order etc

    ReplyDelete