In addition to the standard promotions that are available to customers, Commerce Service Center supports the Commerce Gift with Purchase promotion. This promotion can automatically add a free item to the shopping cart when the order qualifies for a promotion. The gifts can be defined as an SKU, product or a single selection from a category or content group.

When an agent adds an item to an order that qualifies it for a free gift, the free gift is automatically added to the cart with the total price of the item set to $0.00. Note: The gift is added automatically only if the gift is defined as an SKU or product. When a gift is part of a multiple selection, it cannot be automatically added to the cart.

If an agent adds an item to the order that qualifies it for a gift that has multiple choices, a gift selector becomes available. Once the selected gift has been added to the cart, a Change Gift option will be available should the agent need to change the gift to another within the available choices.

The following droplets and form handlers are used by Commerce Service Center to configure the Gift with Purchase promotions. Two of these droplets are located in the /DCS-CSR directory:

/config/atg/commerce/custsvc/promotion/GiftWithPurchaseFormHandler
/config/atg/commerce/custsvc/promotion/GiftWithPurchaseSelectionsDroplet

The third droplet is located in the /DCS directory:

/config/atg/commerce/promotion/GiftWithPurchaseSelectionChoicesDroplet

Name

Description

GiftWithPurchaseFormHandler

Adds the gift selection to the order.

GiftWithPurchaseSelectionDroplet

Determines if an order is eligible for a gift that has not been added to the order. It also determines if an item in the order contains a gift quantity.

GiftWithPurchaseSelectionChoicesDroplet

Determines the available product/SKU combinations that can be selected for the free gift.

For additional and detailed information on the Commerce Gift with Purchase API, refer to the ATG Commerce Programming Guide.

The following three PageFragment components are used to render the Gift with Purchase links on the cart page and the gift selection pop-up. The page fragments are stored in the /DCS-CSR-UI/config/
atg/commerce/custsvc/ui/fragments/gwp
directory:

  • ChangeGiftListPageFragment – This fragment renders the Change Gift link next to an item when it contains a gift that has multiple choices

  • SelectGiftLinkPageFragment – This fragment renders a gift selection link for any gift that has not yet been added to the order. The fragment uses the GiftWithPurchaseSelectionsDroplet to obtain the GiftWithPurchaseSelection objects for the current order. Any GiftWithPurchaseSelection that is found with a quantityMissingFromOrder greater than 0 will have a link rendered for it. If the giftType is category or contentGroup, a selection link is rendered for each unit that is missing from the order. If the giftType is sku or product, a single selection is rendered that adds the entire missing quantity to the cart

  • SelectGiftPopupPageFragment – The SelectGiftPopupPageFragment is used to render the gift selection pop-up. It requires several input parameters for determining the gift choices and initializing the GiftWithPurchaseFormHandler values:

    • itemId – indicates which commerce item references the changed gift selection. The value is optionally provided to the GiftWithPurchaseFormHandler

    • promotionId – The ID of the promotion. Required by the GiftWithPurchaseFormHandler

    • quantity – Required by the GiftWithPurhcaseFormHandler, this provides the quantity of the gift selection

    • giftHashCode – Required by the GiftWithPurchaseFormHandler, this identifies the promotion hash code

    • giftType – Identifies the gift type, and is required for the GiftWithPurchaseSelectionChoicesDroplet

    • giftDetail – Provides gift detail information and is required for the GiftWithPurchaseSelectionChoicesDroplet

For additional information on the GiftWithPurchaseSelectionChoicesDroplet, refer to the ATG Commerce Programming Guide.

Should the agent proceed with checkout without first selecting the eligible gifts for the order, the postMoveToPutchaseInfo method in the CSRCartModifierFormHandler will issue a message to inform the agent that the order qualifies for the gifts that are missing from the order.

The GWPManager queries all Gift with Purchase selections for the order. If any of them have a quantityMissingFromOrder greater than 0, an informational message is posted for the agent, such as “This order qualifies for a free gift that has not yet been selected.”

For additional information on Gift with Purchase configuration, refer to the Extending Objects for Cloning section.


Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved. Legal Notices