Model
CouponManagement
Magento\Quote\Model\CouponManagement
What it does
This class manages coupon codes for shopping carts (quotes) in Magento 2.
Developers use it to retrieve, apply, or remove coupon codes from a customer's cart through the API or service layer.
It validates that carts have items and proper store assignments before allowing coupon operations, and handles error scenarios like invalid coupon codes.
Public Methods
- get()
- set()
- remove()