Class Name

atg.commerce.promotion.GiftWithPurchaseSelectionDroplet

Component(s)

/atg/commerce/promotion/GiftWithPurchaseSelection

If your store uses Gift with Purchase promotions (see the ATG Merchandising Guide for Business Users) you can use this droplet to determine which gift selections the shopper has yet to make.

The selections are output as a collection of GiftWithPurchaseSelection beans. The output can be passed to the GiftWithPurchaseSelectionChoicesDroplet to provide the product and SKU choices available.

If the input includes a commerce item, the following statements apply:

  • This droplet returns details on the Gift with Purchase selections for that item.

  • Each of the quantities only applies to that given commerce item.

  • The quantity and quantityAvailableForSelection are zero, since this only applies when an order is input.

If no commerce item is input then quantityAvailableForSelection is the quantity a customer can still select, and acts as a placeholder for a future selection. Typically the application might do a lookup of the giftType and giftDetail to provide a selector for display, and use the GiftWithPurchaseSelectionChoicesDroplet to get the available product and SKU selections.

Input Parameters

order
This is an optional parameter to pass the order to use to get available gift with purchase selections. If not provided then the current order for the session is used.

item
This is an optional parameter to pass in a commerce item to get the current GWP selections for that item. If not provided then the selections still to be made for the order is output instead.

Output Parameters

selections
This is a collection of GiftWithPurchaseSelection beans.

errorMsg
This is the error message if any error occurred.

Open Parameters

output
Rendered if the selections output parameter is not empty.

empty
Rendered the selections output parameter is empty.

error
Rendered if an error occurred.

Example

As an example, assume that a shopper has qualified for two Gift with Purchase promotions:

The cart already includes 1 Novelty Pen, which is auto targeted to be free. The Gold Bracelet it automatically added to the cart. The shopper has already selected one of the GWP content items, a Gift Certificate. The shopper must still select one Novelty category item and 2 GWP content group items.

With no commerce item input, the GiftWithPurchaseSelectionsDroplet outputs a collection with two GiftWithPurchaseSelection beans:

giftType = 'category', giftDetail = 'Novelty', quantity = 3,
automaticQuantity = 1, selectedQuantity = 0, targetedQuantity = 1,
quantityAvailableForSelection = 1
giftType = 'contentGroup', giftDetail = 'GWP', automaticQuantity = 0,
selectedQuantity = 1, targetedQuantity = 0, quantityAvailableForSelection
= 2

With the Gift Certificate commerce item as input, the GiftWithPurchaseSelectionsDroplet outputs a collection with one GiftWithPurchaseSelection bean:

giftType = 'contentGroup', giftDetail = 'GWP', quantity = 0,
automaticQuantity = 0, selectedQuantity = 1, targetedQuantity = 0,
quantityAvailableForSelection = 0

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