canManageCookie = $canManageCookie; } /** * Need to overwrite parent method to avoid build the URL * * @inheritDoc */ public function getHref(): string { return $this->getPath(); } /** * If customer cannot manage cookie we should not show link * * @return string */ protected function _toHtml() { if (! $this->canManageCookie->execute()) { return ''; } return parent::_toHtml(); } }