Line Items belong to an Order and contain information about the purchasable added to the cart. They also contain information on the quantity of that purchasable as well as totals, tax, shipping, and promotion information that get used to calculate the line item total.
The ID of the line item.
The standard price of the purchasable.
The amount of sales discount that should be applied to the price. Usually a negative number. To determine how this number was calculated, see the salesApplied
attribute.
The price after saleAmount applied. Price + Sale Amount.
How many of this purchasable are being purchased in this line item.
salePrice * qty
Tax applied to the line item
Shipping costs applied to the line item
Discount applied to the line item
Sum of subtotal + tax + shippingCost + discount
.
The length of the variant on this line item
The weight of the variant on this line item
The height of the variant on this line item
The width of the variant on this line item
The note added to the line item when the purchasable was added to the cart, or updated.
The snapshot is json encoded information about the purchasable at the time of when the lineitem was last updated. This means if the purchasable (variant) is deleted you can still get to core information about what was purchased.
The OrderModel this line item belongs to.
The purchasable Model that this line item represents. This will likely be a VariantModel in most cases, unless you have installed additional purchasables.
The tax category the purchasable belongs to.
Whether the lineItem's price
is different to the salePrice
.
An array of Commerce_SaleModels
that were used to calculate the salePrice
of this variant. You could also check the length of this array to determine if the variant is on sale. e.g `{% if variant.salesApplied|length %}This variant is on sale{% endif %}