Pipelet: Basket AddBonusProductToBasket
Pipelet AddBonusProductToBasket
Adds a bonus product to the Basket associated with the specified BonusDiscountLineItem. The pipelet creates and returns a ProductLineItem, by assigning the specified Product and Quantity to the specified Basket. If this process fails, then the pipelet exits with an ERROR. Otherwise the pipelet adds the new ProductLineItem to the specified shipment or the default shipment if not specified.
The passed product must be one of the products associated with the BonusDiscountLineItem or the process will fail. The process does NOT validate if the number of bonus products exceeds the maximum allowed by the bonus discount. This is the job of application logic.
Pipelet always creates a new product line item, regardless of the value of the site preference 'Add Product Behavior'.
Group:
Basket
Flags:
Error Connector
Transaction Required
Input Parameters
Basket : Basket Required
The basket to add the product to.
BonusDiscountLineItem : BonusDiscountLineItem Required
Line item representing an applied BonusChoiceDiscount in the basket. The product must be in the bonus product list of this discount.
Product : Product Required
The product that is to be added to the basket.
Quantity : Number Required
The quantity of the product.
ProductOptionModel : ProductOptionModel Optional
The option model of the product that is to be added to the basket.
Shipment : LineItemGroup Optional
Specifies the shipment the bonus product should be added to. If not specified, the pipelet automatically adds the product to the default shipment of the basket.
Output Parameters
ProductLineItem : ProductLineItem : Optional
The newly created product line item.