Fluent builder for constructing a CustomCheckoutRuleLineItem, used by custom checkout rule implementations (including JS-based rule scripts) to add priced items such as points rewards to the checkout preview. Each setter returns the builder itself so calls can be chained; call build to produce the finished line item. A rule script obtains one from the lineItemBuilder() method on the rule wrapper passed to it.
Group: Builders
Methods
productSku(ProductSku p) · quantity(BigDecimal p) · quantity(Long p) · quantity(Double d) · costExTax(BigDecimal p) · tax(BigDecimal p) · taxRate(BigDecimal p) · description(String p) · build()
productSku(ProductSku p)
Returns: CheckoutLineItemBuilder
Sets the product SKU this line item relates to, if any.
| Parameter | Description |
|---|---|
p | the product SKU |
quantity(BigDecimal p)
Returns: CheckoutLineItemBuilder
Sets the quantity for this line item.
| Parameter | Description |
|---|---|
p | the quantity |
quantity(Long p)
Returns: CheckoutLineItemBuilder
Sets the quantity for this line item from a whole number.
| Parameter | Description |
|---|---|
p | the quantity, ignored if null |
quantity(Double d)
Returns: CheckoutLineItemBuilder
Sets the quantity for this line item from a floating point number.
| Parameter | Description |
|---|---|
d | the quantity, ignored if null |
costExTax(BigDecimal p)
Returns: CheckoutLineItemBuilder
Sets the price for this line item, excluding tax.
| Parameter | Description |
|---|---|
p | the price excluding tax |
tax(BigDecimal p)
Returns: CheckoutLineItemBuilder
Sets the tax amount for this line item.
| Parameter | Description |
|---|---|
p | the tax amount |
taxRate(BigDecimal p)
Returns: CheckoutLineItemBuilder
Sets the tax rate for this line item.
| Parameter | Description |
|---|---|
p | the tax rate |
description(String p)
Returns: CheckoutLineItemBuilder
Sets the description shown to the customer for this line item.
| Parameter | Description |
|---|---|
p | the item description |
build()
Returns: CustomCheckoutRuleLineItem
Builds the CustomCheckoutRuleLineItem from the values set on this builder.