CollectionDiscounts
Trait to fetch discounts from an ItemPriceCollection
Table of Contents
Methods
| getDiscounts() | Retrieves the discounts for all items in the collection |
Methods
getDiscounts()
Retrieves the discounts for all items in the collection
protected
getDiscounts(ItemPriceCollection $collection) : array<string|int, mixed>
Parameters
- $collection : ItemPriceCollection
-
The collection from which to fetch all discounts
Return values
array<string|int, mixed> —An array of stdClass objects representing each discount, including:
- description The discount description
- amount The discount amount
- type The discount type
- total The total amount actually discounted