The Gift with Purchase promotion creates markers to track quantities of gifts, for example the amount of overall gifts available to the customer, the amount selected, returned, failed, etc. Two markers are specifically created, the gwpOrderMarker and gwpCommerceItemMarker. The gwpOrderMarker tracks the overall quantities of the gift commerce items. The gwpCommerceItemMarker tracks the quantities at a specific commerce item level.

Gift with Purchase markers only persist while the order still qualifies for the promotion. If the promotion no longer applies, associated markers are removed.

The gwpOrderMarker item type has the following properties:

Property

Data Type

Description

key

string

This value is always atg.gwp.

value

string

The promotionId.

data

string

Hash code to track which gift selection in the promotion this is. It allows the commerce item marker to link to this marker. A hash of the PMDL discount detail for a single gift selection given by the promotion.

giftType

string

The type of gift, which can be sku, product, category, skuContentGroup, or productContentGroup.

giftDetail

string

String identifying the gift, usually the repository ID of the gift type.

autoRemove

boolean

Flag to indicate whether free gifts should be automatically removed if the promotion no longer qualifies. This is configured by the merchandiser when the promotion is created.

quantity

long

The total quantity of SKUs for this gift selection, this is the quantity from the PMDL multiplied by the number of times the offer applied (if it applied more than once).

quantityWith
  Fraction

double

The total quantity of the fraction-enabled SKUs for this gift selection. For example .5lbs or .25 yard.

automaticQuantity

long

The quantity of free SKUs for this gift selection that has already been automatically added to the order.

automaticQuantity
  WithFraction

double

The quantity of free fraction-enabled SKUs for this gift selection that has already been automatically added to the order.

targetedQuantity

long

The quantity of free SKUs for this gift selection that has already been targeted and made free by the calculator in the order.

targetedQuantity
  WithFraction

double

The quantity of free fraction-enabled SKUs for this gift selection that has already been targeted and made free by the calculator in the order.

selectedQuantity

long

The quantity of free SKUs for this gift selection that has already been selected by the shopper and added to the order.

selectedQuantity
  WithFraction

double

The quantity of free fraction-enabled SKUs for this gift selection that has already been selected by the shopper and added to the order.

removedQuantity

long

The amount of the free quantity that has been manually removed by the shopper. Keeping track of removed quantities prevents them from being automatically re-added in future pricing operations. The assumption is that the customer does not want the free item.

removedQuantity
  WithFraction

double

Similar to the removedQuantity property, but contains the free fraction-enabled quantity.

failedQuantity

long

Tracks any gifts that should have been automatically added but failed, for example due to a site conflict with the promotion.

failedQuantityWith
  Fraction

double

Similar to the failedQuantity property, but tracks quantity of fraction-enabled gifts.

The key, value and data properties are required to look up marker objects. The combined value and data properties are unique for a given gwpOrderMarker.

The gwpCommerceItemMarker repository item has similar properties, as shown in the following table:

Property

Data Type

Description

key

string

The value is always atg.gwp.

value

string

The promotionId.

data

string

The gift hash code for the promotion, a hash of the PMDL discount detail for a single gift selection given by the promotion.

targetedQuantity

long

The quantity of free gifts for this gift selection that has already been targeted and made free by the calculator in the order.

targetedQuantity
  WithFraction

double

The quantity of the fraction-enabled free gifts for this gift selection that has already been targeted and made free by the calculator in the order.

automaticQuantity

long

The quantity of free gift for this gift selection that has already been automatically added to the order.

automaticQuantity
 WithFraction

double

The quantity of the fraction-enabled free gifts for this gift selection that was automatically added to the order.

selectedQuantity

long

The quantity of the free gift that this commerce item is making free and was selected by the shopper.

selectedQuantity
 WithFraction

double

The quantity of the fraction-enabled free gift that the shopper has selected.

remainingQuantity

long

The total quantity of the commerce item that does not apply to this gift. Used to detect when a commerce item quantity is removed, to ensure the gift quantities are updated correctly.

remainingQuantity
  WithFraction

double

The total quantity of the fraction-enabled commerce item that does not apply to this gift.

The value and data properties are used to match the gwpCommerceItemMarker to the related gwpOrderMarker that relates to this commerce item marker.

The targeted, automatic, and selected quantities and quantities with fraction properties track how much of the total quantity of the gift is provided by the commerce item. Multiple commerce items can contribute to the total quantity. For example, a Gift with Purchase promotion could offer a free gift of two watches. The shopper selects two different watches, creating two commerce items. Each commerce item has an associated gwpCommerceItemMarker, each of which refers to the same gwpOrderMarker. Each gwpCommerceItemMarker has a selectedQuantity of 1.

For further information, refer to the ATG Platform API Reference.


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