2015-04-04 215 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