2

We can assign a promotion to a coupon and redeem it in ATG 10.0.x. How can we find out which promotion is applied from which coupon in atg order?

Do we have this out of the box or need to do any customization to add this?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Nagarjuna
  • 25
  • 1
  • 6

3 Answers3

2

I suppose the question is to find / query orders in which a particular coupon cum promotion is applied. Can do that by mapping the order price-info objects with the adjustments tagged to the price-info objects.

A simple query would be like..

select * from dcspp_order where price_info in (
select amount_info_id from dcspp_amtinfo_adj where adjustments in 
(select dcspp_price_adjust.ADJUSTMENT_ID from dcspp_price_adjust where coupon_id = '<coupon_code>'));
Muralidharan.rade
  • 2,226
  • 1
  • 24
  • 34
0

Applied promotions are stored as adjustments against the PriceInfo component to which they applied. So if you have a coupon for Free Shipping you can get back the applied discount as follow:

        OrderPriceInfo orderPriceInfo = order.getPriceInfo();
        Map<String, OrderPriceInfo> shippingItemsPriceInfos = orderPriceInfo.getShippingItemsSubtotalPriceInfos();

        OrderPriceInfo shippingItemsPriceInfo = shippingItemsPriceInfos.get(shippingGroup.getId());

        List<PriceAdjustment> adjs = shippingItemsPriceInfo.getAdjustments();
radimpe
  • 3,197
  • 2
  • 27
  • 46
  • Also there is a method in ClaimableTools to get the coupons for a promotion, if you want to find out the coupons programmatically. `RepositoryItem[] getCouponsForPromotion(String pPromotionId)` – boyintello Jan 30 '14 at 05:02
  • Thanks for the replies. @ radimpe : I want to know how can we get the relationship that this PriceAdjustment is applied due to this perticular coupon? – Nagarjuna Jan 30 '14 at 06:19
0

dcs_usr_actvpromo: This table is xref table with sequence number for promo stat table.

dcs_usr_promostat: This will have the list of the promotions with the expiration date tagged to the profile

dcs_usr_usedpromo: This table will have the used promotions from the profile (promotions which are already used from the customer)