Model
Item
Magento\Catalog\Model\Product\Compare\Item
What it does
This class manages individual items in a customer's product comparison list in Magento 2.
Developers use it to add/remove products from compare lists, handle customer login/logout scenarios (transferring compare items from visitor to customer), and retrieve comparison data for both logged-in customers and guest visitors.
Public Methods
- beforeSave()
- addVisitorId()
- loadByProduct()
- addProductData()
- getDataForSave()
- bindCustomerLogin()
- bindCustomerLogout()
- clean()
- getCustomerId()
- getVisitorId()
- getIdentities()