Skip to content

Order ​

Type
Class
Namespace
craft\commerce\helpers
Inherits
craft\commerce\helpers\Order
Since
2.1

Order helper

View source

Public Methods ​

MethodDescription
mergeDuplicateLineItems()
normalizeLineItemPurchasableAvailability()Removes any line items from the cart that are no longer available.

mergeDuplicateLineItems() ​

View source

Arguments ​

  • $order

Returns ​

boolean – Were any line items merged?

normalizeLineItemPurchasableAvailability() ​

Since
4.9.3

Removes any line items from the cart that are no longer available.

If a line item is available but the quantity is more than the available stock, the quantity will be reduced to the available stock. A notice will be added to the cart for each change.

View source

Arguments ​

Returns ​

void

Throws ​