This website uses cookies to ensure you get the best experience on our website. Read more
Furniture
- Latest Products
-
Madri Oak/Black Gamer Desk
JMD 153.30 -
Frigidaire 12 kg Twin Tub Washer
JMD 266.63 -
Dell Inspiron 3505 Laptop
JMD 726.63
public function drawMainMenu() { if ($this->hasData('mainMenu')) { return $this->getData('mainMenu'); } $desktopHtml = []; $mobileHtml = []; $rootCategory = $this->getRootCategory(); $storeId = $this->_storeManager->getStore()->getId(); $categories = $this->getTreeMenu($storeId, $rootCategory->getId()); $contentCatTop = $this->getContentCatTop(); foreach ($contentCatTop as $ext) { $this->extData[$ext->getCatId()] = $ext->getData(); } // --- Safe handling for dropdown IDs --- $dropdownValue = $this->_sysCfg->general['dropdown'] ?? ''; $dropdownValue = is_string($dropdownValue) ? $dropdownValue : ''; $dropdownIds = $dropdownValue !== '' ? explode(',', $dropdownValue) : []; $counter = 1; $this->removeChildrenWithoutActiveParent($categories, 0); foreach ($categories as $catTop) { $itemPositionClassPrefix = 'nav-' . $counter; $idTop = $catTop->getEntityId(); $urlTop = '' . $this->getThumbnail($catTop) . '' . $catTop->getName() . $this->getCatLabel($catTop) . '' . ''; $classTop = $itemPositionClassPrefix . ' ' . $this->_getActiveClasses($idTop); $isDropdown = in_array($idTop, $dropdownIds) ? ' dropdown' : ''; $options = ''; if ($isDropdown) { $classTop .= $isDropdown; $catChild = $catTop->getChildren(); $childHtml = $this->getTreeCategories($catChild, $itemPositionClassPrefix); $menu = ['desktop' => $childHtml, 'mobile' => $childHtml]; } else { $data = $this->extData[$idTop] ?? []; $blocks = ['top' => '', 'left' => '', 'right' => '', 'bottom' => '']; if (!empty($data)) { foreach ($blocks as $key => $value) { $html = $this->getStaticBlock($data[$key] ?? ''); if ($html) $blocks[$key] = "