Line Item Model

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.

id #

The ID of the line item.

price #

The standard price of the purchasable.

saleAmount #

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.

salePrice #

The price after saleAmount applied. Price + Sale Amount.

qty #

How many of this purchasable are being purchased in this line item.

subtotal #

salePrice * qty

tax #

Tax applied to the line item

shippingCost #

Shipping costs applied to the line item

discount #

Discount applied to the line item

total #

Sum of subtotal + tax + shippingCost + discount.

length #

The length of the variant on this line item

weight #

The weight of the variant on this line item

height #

The height of the variant on this line item

width #

The height of the variant on this line item

note #

The note added to the line item when the purchasable was added to the cart, or updated.

snapshot #

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.

order #

The OrderModel this line item belongs to.

purchasable #

The purchasable Model that this line item represents. This will likely be a VariantModel in most cases, unless you have installed additional purchasables.

taxCategory #

The tax category the purchasable belongs to.

onSale #

Whether the lineItem’s price is different to the salePrice.

salesApplied #

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 %}

Buy Craft Commerce

Craft Commerce site license

Includes

  • Standard tech support
  • Unlimited app updates
  • Craft Pro site license
Buy now for $999
Can I try before buying?

Absolutely. Just download it from the “Download” button in the site header and follow our installation instructions. You’ll have the full feature set to experiment with, with just one limitation: you won’t be able to charge credit cards. Until Craft Commerce has been purchased and activated, it’s limited to a single dummy gateway.

Will there be recurring/upgrade fees?

Nope, it’s just a one-time license fee per site.

Can I use this on an existing Craft site?

Yes! And if you already have a Craft Pro license (or you don’t need one), just flip that “Include a Craft Pro license” switch in the purchase form, and we’ll drop the price to $700.

Is Craft Pro required?

Craft Commerce does not require Craft Pro; it works perfectly fine on Craft Client and Personal editions as well!

Can I try before buying?

Absolutely. Just download it from the “Download” button in the site header and follow our installation instructions. You’ll have the full feature set to experiment with, with just one limitation: you won’t be able to charge credit cards. Until Craft Commerce has been purchased and activated, it’s limited to a single dummy gateway.

Will there be recurring/upgrade fees?

Nope, it’s just a one-time license fee per site.

Can I use this on an existing Craft site?

Yes! And if you already have a Craft Pro license (or you don’t need one), just flip that “Include a Craft Pro license” switch in the purchase form, and we’ll drop the price to $700.

Is Craft Pro required?

Craft Commerce does not require Craft Pro; it works perfectly fine on Craft Client and Personal editions as well!