正如标题所描述的,我的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>
目录/ layer / 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 :(得分: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();