_wishlistHelper = $wishlistHelper; parent::__construct($context, $data); } /** * @return string */ protected function _toHtml() { if ($this->_wishlistHelper->isAllow()) { return parent::_toHtml(); } return ''; } /** * @return string */ public function getHref() { return $this->getUrl('wishlist'); } /** * @return \Magento\Framework\Phrase */ public function getLabel() { return __('My Wish List'); } /** * {@inheritdoc} * @since 101.0.0 */ public function getSortOrder() { return $this->getData(self::SORT_ORDER); } }