
The following example shows the default item-descriptor for coupons: The other step to consider when you set up coupons is to make sure that there are coupons in the Claimable repository for a customer to claim.
#TG PRO COUPON HOW TO#
For information on how to extend the commerce object hierarchy to include a new property, refer to Extending the Purchase Process in the Customizing Purchase Process Externals chapter.
#TG PRO COUPON CODE#
You can persist a coupon code with an order by adding a new property to the Order object and storing the coupon code in the new property. A claimed coupon is automatically applied to any order to which it qualifies there’s no need to claim a coupon twice. This double-checking capability ensures that if a user claims a coupon as part of one order, discontinues that order, then creates a second one, the promotion applies to the second order, as long as the promotion is active and applicable.Ī promotion given by a coupon persists on the user profile, not as part of the order. The order meets the requirements of the promotion During order pricing, ATG Commerce determines whether the order qualifies for the coupon’s promotion by checking that: If both conditions are met, the user “claims” the coupon, which means that the promotion is added to the user’s activePromotions profile property. When a user enters a coupon code on a Checkout page, ATG Commerce checks that the coupon is active and the promotion associated with it is not expired. The following example shows the JSP code for using the CouponFormHandler component: Then it extracts the promotion from the coupon and uses the PromotionTools component to place the promotion into the customer’s user profile. This method uses the ClaimableManager component to attempt to get a coupon from the Claimable repository. Then, have the form submit to the handleClaimCoupon method of the form handler. Create an input field on an appropriate site page (for example, a Checkout page) and hook it up to the couponClaimCode property of the CouponFormHandler component.

Use the /atg/commerce/promotion/CouponFormHandler component to obtain a coupon code and add it to a customer’s list of promotions in the customer’s activePromotions profile property.

For example, COUP100 and coup100 are two different coupon codes.Īdd the resulting promotion to the activePromotions list in the user profile. Note that coupon codes are case-sensitive. Try to claim the coupon from the ClaimableRepository.
