_registry = $registry; } /** * Retrieve current order model instance * * @return \Magento\Sales\Model\Order */ private function getOrder() { return $this->_registry->registry('current_order'); } /** * @inheritdoc * * @return string */ public function getHref() { return $this->getUrl($this->getPath(), ['order_id' => $this->getOrder()->getId()]); } /** * @inheritdoc * * @return string */ protected function _toHtml() { if ($this->hasKey() && method_exists($this->getOrder(), 'has' . $this->getKey()) && !$this->getOrder()->{'has' . $this->getKey()}() ) { return ''; } return parent::_toHtml(); } }