Compare
Magento\Quote\Model\Quote\Item\Compare
What it does
This class is used to compare two quote items to determine if they represent the same product with the same configuration options.
Developers use this when checking if an item being added to the cart already exists, helping prevent duplicate entries and enabling quantity updates instead.
It handles complex option comparisons including serialized data and filters out irrelevant fields like quantity and URLs.
Public Methods
- compare()
- getOptions()