FreeGiftSelection container
The FreeGiftSelection container lets shoppers choose and add promotional free gifts to their cart. When a cart qualifies for a free-gift promotion, the container shows a trigger button that opens a modal where the shopper selects a gift and configures any required options.
The container reads the available offers from the cart’s free-gift data and adds the chosen gift with the selectFreeGiftForCart function. The cart summary containers (CartSummaryTable, CartSummaryList, and CartSummaryGrid) pass their live cart model to this container through the cartData prop.
Configurations
Section titled “Configurations”The FreeGiftSelection container provides the following configuration options:
| Parameter | Type | Req? | Description |
|---|---|---|---|
showTrigger | boolean | No | Shows the trigger button when the cart has pending free gifts. Defaults to true. |
cartData | CartModel | null | No | An optional cart model override. The cart summary containers pass their live cart model here. Omit it to use the active cart. |
Example
Section titled “Example”The following example demonstrates how to render the FreeGiftSelection container:
provider.render(FreeGiftSelection, { showTrigger: true,})('#free-gift-selection');