Nagarjuna
Nagarjuna

Reputation: 25

how to findout a promotion applied from a coupon in atg

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?

Upvotes: 2

Views: 3630

Answers (3)

Muralidharan.rade
Muralidharan.rade

Reputation: 2336

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>'));

Upvotes: 2

user3265967
user3265967

Reputation: 31

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)

Upvotes: 0

radimpe
radimpe

Reputation: 3215

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();

Upvotes: 0

Related Questions