/** * Clear compare items by condition * * @return $this */ public function clear() { $this->_catalogProductCompareItem->clearItems($this->getVisitorId(), $this->getCustomerId()); $this->_eventManager->dispatch('catalog_product_compare_item_collection_clear'); return $this; }