Strona główna forum Wsparcie Szablony Magento... Błąd w menu

Błąd w menu

Forum poświęcone projektowaniu layout'ów dla Magento...

Post 7 paź 2014, o 18:57

Posty: 5
Gadu-Gadu: 0

nagle wyskoczył mi błąd w menu ,którego nie ruszałem.

http://sklep.weider-polska.pl/

Fatal error: Call to a member function count() on a non-object in /home/platne/weider/public_html/sklep/app/design/frontend/default/blank/template/catalog/navigation/left_menu.phtml on line 3

Plik left_menu.phtml wygląda tak:

<?php
$_main_categories=$this->getStoreCategories(10);
if($_main_categories->count())
{
?><ul><?
   foreach ($_main_categories as $_main_category)
   {
   ?><li class="<?=$_main_category->getName()?><? if ($this->isCategoryActive($_main_category)) : ?> active<? endif; ?>"><a href="<?=$this->getCategoryUrl($_main_category)?>"<? if ($this->isCategoryActive($_main_category)) : ?> class="active"<? endif; ?>><?=$_main_category->getName()?></a></li><?
      if ($this->isCategoryActive($_main_category))
      {
         $children = $_main_category->getChildren();
         $hasChildren = $children && $children->count();
         if ($hasChildren)
         {
            ?><ul><?
            foreach ($children as $child)
            {
               ?><li><a href="<?=$this->getCategoryUrl($child)?>"<? if ($this->isCategoryActive($child)) : ?> class="active"<? endif; ?>><?=$child->getName()?></a></li><?
               if ($this->isCategoryActive($child))
               {
                  $childrenL3 = $child->getChildren();
                  $hasChildrenL3 = $childrenL3 && $childrenL3->count();
                  if ($hasChildrenL3)
                  {
                  ?><ul id="menu_level3"><?
                     foreach ($childrenL3 as $childL3)
                     {
                     ?><li><a href="<?=$this->getCategoryUrl($childL3)?>"<? if ($this->isCategoryActive($childL3)) : ?> class="active"<? endif; ?>><?=$childL3->getName()?></a></li><?
                     }
                     ?></ul><?
                  }
               }
            }
            ?></ul><?
         }
      }      
   }
   ?></ul><?
}?>

Błąd w menu

PostTeraz jest 28 mar 2024, o 16:11
Google

Posty: 427
Lokalizacja: Internet

Post 13 paź 2014, o 21:02

Posty: 729
Gadu-Gadu: 0

Wklej zrzut ekranu bo ja nie widzę tego błędu.
Magento krok po kroku - aktualne informacje ze świata magento.

Post 13 paź 2014, o 21:57

Posty: 1575
Gadu-Gadu: 0

spróbuj w 3 linijce if(count($_main_categories)) a jak nic nie da to widocznie $_main_categories=$this->getStoreCategories(10); jest błędne, czy na pewno masz kategorie o ID 10 i czy można to tak wykonać?
hosting-magento.pl / magentohosting.eu - szybki hosting Magento
https://www.mage24.pl/ - twój sklep Magento 2 w 5 minut


Powrót do Szablony Magento...



cron