2015-04-04 197 views
0

由於標題描述我的Magento商店顯示空白類別頁面。我有以下誤差輸出:Magento空白/空(錨)類別頁

Fatal error: Call to a member function setData() on a non-object in /app/code/local/Mage/Tax/Model/Calculation.php on line 411 
Warning: include(Mage.php) [function.include]: failed to open stream: No such file or directory in /lib/Varien/Autoload.php on line 94 
Warning: include(Mage.php) [function.include]: failed to open stream: No such file or directory in /lib/Varien/Autoload.php on line 94 
Warning: include() [function.include]: Failed opening 'Mage.php' for inclusion (include_path='app/code/local:app/code/community:/app/code/core:/lib:.') in /lib/Varien/Autoload.php on line 94 
Fatal error: Class 'Mage' not found in /app/code/core/Mage/Core/functions.php on line 244 
Warning: include(Mage.php) [function.include]: failed to open stream: No such file or directory in /lib/Varien/Autoload.php on line 94 
Warning: include(Mage.php) [function.include]: failed to open stream: No such file or directory in /lib/Varien/Autoload.php on line 94 
Warning: include() [function.include]: Failed opening 'Mage.php' for inclusion (include_path='app/code/local:app/code/community:/app/code/core:/lib:.') in /lib/Varien/Autoload.php on line 94 
Fatal error: Class 'Mage' not found in /app/code/core/Mage/Core/Model/Resource/Session.php on line 108 

Calculation.php - 第8行是線411

protected function _getRates($request, $fieldName, $type) 
    { 
     $result = array(); 
     $classes = Mage::getModel('tax/class')->getCollection() 
      ->addFieldToFilter('class_type', $type) 
      ->load(); 
     foreach ($classes as $class) { 
      $request->setData($fieldName, $class->getId()); 
      $result[$class->getId()] = $this->getRate($request); 
     } 

     return $result; 
    } 

Autoload.php - 第13行是行94

public function autoload($class) 
    { 
     if ($this->_collectClasses) { 
      $this->_arrLoadedClasses[self::$_scope][] = $class; 
     } 
     if ($this->_isIncludePathDefined) { 
      $classFile = COMPILER_INCLUDE_PATH . DIRECTORY_SEPARATOR . $class; 
     } else { 
      $classFile = str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $class))); 
     } 
     $classFile.= '.php'; 
     //echo $classFile;die(); 
     return include $classFile; 
    } 

的functions.php - 第2行是244行

$errorMessage .= ": {$errstr} in {$errfile} on line {$errline}"; 
    if (Mage::getIsDeveloperMode()) { 
     throw new Exception($errorMessage); 
    } else { 
     Mage::log($errorMessage, Zend_Log::ERR); 
    } 

Session .PHP - 2號線是線108

 if (is_null($this->_lifeTime)) { 
      $configNode = Mage::app()->getStore()->isAdmin() ? 
        'admin/security/session_cookie_lifetime' : 'web/cookie/cookie_lifetime'; 
      $this->_lifeTime = (int) Mage::getStoreConfig($configNode); 

**更新**

我剛剛發現的時候我刪除了4號線類別頁面會顯示出來。但是(邏輯上)沒有分層導航。

<catalog_category_layered translate="label"> 
     <label>Catalog Category (Anchor)</label> 
     <reference name="left"> 
      <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/> 
     </reference> 
    </catalog_category_layered> 

目錄/層/ view.phtml是這個樣子:

<?php if($this->canShowBlock()): ?> 
<div class="block block-layered-nav"> 
    <div class="block-content"> 
     <?php echo $this->getStateHtml() ?> 
     <?php if ($this->getLayer()->getState()->getFilters()): ?> 
      <div class="actions"><a href="<?php echo $this->getClearUrl() ?>"><?php echo $this->__('Clear All') ?></a></div> 
     <?php endif; ?> 
     <?php if($this->canShowOptions()): ?> 
      <dl id="narrow-by-list"> 
       <?php $_filters = $this->getFilters() ?> 
       <?php foreach ($_filters as $_filter): ?> 
       <?php if($_filter->getItemsCount()): ?> 
        <dt><?php echo $this->__($_filter->getName()) ?></dt> 
        <dd><?php echo $_filter->getHtml() ?></dd> 
       <?php endif; ?> 
       <?php endforeach; ?> 
      </dl> 
      <script type="text/javascript">decorateDataList('narrow-by-list')</script> 
      <script type="text/javascript"> 
       jQuery(function($){ 
        $(".block-layered-nav dt").click(function(){ 
         if($(this).next("dd").css("display") == "none"){ 
          $(this).next("dd").slideDown(200); 
          $(this).removeClass("closed"); 
         } else { 
          $(this).next("dd").slideUp(200); 
          $(this).addClass("closed"); 
         } 
        }); 
       }); 
      </script> 
     <?php endif; ?> 
    </div> 
</div> 
<?php endif; ?> 

我還能不能找到這個問題。

-

我希望有人能幫我解決這個問題。

+0

請發表您的代碼,否則我們不能幫你。 – ByteHamster 2015-04-04 19:43:32

+0

謝謝!我已經在問題中發佈了代碼。 – Laurenze 2015-04-04 20:01:19

+0

只需縮進代碼(不要使用代碼片段)。代碼片段僅適用於HTML/CSS/Javascript。 :) – ByteHamster 2015-04-04 20:07:12

回答

0

檢查app/Mage.php是否存在。同時檢查它的權限。 用下面的代碼創建了根新文件:

require_once("app/Mage.php"); 
umask(0); 
Mage::app(); 

error_reporting(E_ALL | E_STRICT); 
ini_set('display_errors', 1); 
Mage::init(); 
+0

似乎不起作用。我剛剛發現只有錨點類別是空白的。 – Laurenze 2015-04-06 11:00:05

+0

我的代碼不工作?現在Mage.php文件和它的權限呢? – zhartaunik 2015-04-06 11:07:33

+0

不,我將你的代碼添加到index.php。 Mage.php的存在,並確保我偶然的權限爲777,默認爲644. – Laurenze 2015-04-06 11:44:12