public final class GiftLineItemCartDiscountValue extends Base implements CartDiscountValue
LineItemMode.GIFT_LINE_ITEM
.
Like all other line items, it has the LineItem.getPrice()
field set (it is therefore necessary that the
variant has a price defined that can be selected for each cart the discount should be applied to).
The LineItem.getTotalPrice()
has a `centAmount` of `0`.
The LineItem.getDiscountedPricePerQuantity()
discounts the full price and links back to this cart discount.
If at creation time the discount can not be applied to any cart (e.g. because the product, the variant, or a channel does not exist), the creation fails.
The discount will not be applied to a cart if it either has become invalid since the creation (e.g. because the product, the variant, or a channel have been deleted)
or because no price can be selected for the particular cart.Modifier and Type | Method and Description |
---|---|
ResourceIdentifier<Channel> |
getDistributionChannel() |
ResourceIdentifier<Product> |
getProduct() |
ResourceIdentifier<Channel> |
getSupplyChannel() |
Integer |
getVariantId() |
static GiftLineItemCartDiscountValue |
of(ResourceIdentifier<Product> product,
Integer variantId,
ResourceIdentifier<Channel> supplyChannel,
ResourceIdentifier<Channel> distributionChannel) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
ofAbsolute, ofAbsolute, ofFixed, ofGiftLineItem, ofGiftLineItem, ofRelative
public ResourceIdentifier<Product> getProduct()
public Integer getVariantId()
@Nullable public ResourceIdentifier<Channel> getSupplyChannel()
@Nullable public ResourceIdentifier<Channel> getDistributionChannel()
public static GiftLineItemCartDiscountValue of(ResourceIdentifier<Product> product, Integer variantId, @Nullable ResourceIdentifier<Channel> supplyChannel, @Nullable ResourceIdentifier<Channel> distributionChannel)