CartFixedDiscount
Magento\SalesRule\Helper\CartFixedDiscount
What it does
This helper class handles discount calculations for cart-level fixed amount discount rules in Magento 2.
Developers use it to calculate proportional discount amounts across items, handle shipping discounts, and manage special cases like multi-shipping addresses and tax-inclusive pricing.
It ensures discounts are distributed fairly based on item prices and quantities relative to cart totals.
Public Methods
- calculateShippingAmountWhenAppliedToShipping()
- getDiscountAmount()
- getDiscountedAmountProportionally()
- getShippingDiscountAmount()
- checkMultiShippingQuote()
- getQuoteTotalsForMultiShipping()
- getQuoteTotalsForRegularShipping()
- getBaseRuleTotals()
- getAvailableDiscountAmount()
- applyDiscountOnPricesIncludedTax()