/** * Check - specified item is active or not * * @param array $item Menu item * * @return boolean */ protected function isActiveItem(array $item) { $result = parent::isActiveItem($item); if (false === $item['controller']) { $result = \XLite::getInstance()->getShopURL($item['url']) === \XLite\Core\URLManager::getCurrentURL() ?: $result; } else { if (!is_array($item['controller'])) { $item['controller'] = array($item['controller']); } $controller = \XLite::getController(); foreach ($item['controller'] as $controllerName) { if ($controller instanceof $controllerName) { $result = true; break; } } } return $result; }
/** * Check if widget is visible * * @return boolean */ protected function isVisible() { return parent::isVisible() && !$this->isCheckoutLayout(); }