我刚刚安装了一个简单的扩展来显示按属性集分组的属性。安装后我收到此错误:
exception 'Mage_Core_Exception' with message 'Invalid block type: ' in C:\wamp\www\mg1\app\Mage.php:595
下面是它安装的2个文件(我手动找到它们): 任何人都可以告诉我在哪里可以先找到解决错误的原因吗?
布局文件: \应用\设计\前端\基\默认\布局\ AttributesAsGroup.xml
<layout version="0.1.0">
<catalog_product_view>
<reference name="content">
<block name="product.info" >
<block type="Webguys_AttributesAsGroup/Groupview" name="product.attributes" as="additional" template="webguys/attributesasgroup/groupview.phtml">
<action method="addToParentGroup"><group>detailed_info</group></action>
</block>
</block>
</reference>
</catalog_product_view>
</layout>
这是模板文件 \应用\设计\前端\基\默认\模板\ webguys \ attributesasgroup
<?php
$_helper = $this->helper('catalog/output');
$_product = $this->getProduct()
?>
<?php if($_additionalgroup = $this->getAdditionalData()): ?>
<div class="box-collateral box-additional">
<h2><?php echo $this->__('Additional Information') ?></h2>
<?php $i=0; foreach ($_additionalgroup as $_additional): $i++; ?>
<h3><?php echo $this->__( $_additional['title'] )?></h3>
<table class="data-table" id="product-attribute-specs-table-<?php echo $i?>">
<col width="25%" />
<col />
<tbody>
<?php foreach ($_additional['items'] as $_data): ?>
<tr>
<th class="label"><?php echo $this->htmlEscape($this->__($_data['label'])) ?></th>
<td class="data"><?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<script type="text/javascript">decorateTable('product-attribute-specs-table-<?php echo $i?>')</script>
<?php endforeach; ?>
</div>
<?php endif;?>
答案 0 :(得分:0)
此扩展程序不适用。
i have modify app\code\community\Webguys\AttributesAsGroup\etc\config.xml in
和代码是
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Webguys_AttributesAsGroup>
<version>1.0.0</version>
</Webguys_AttributesAsGroup>
</modules>
<global>
<blocks>
<attributesasgroup>
<class>Webguys_AttributesAsGroup_Block</class>
</attributesasgroup>
</blocks>
</global>
<frontend>
<layout>
<updates>
<attributesasgroup>
<file>attributesasgroup.xml</file>
</attributesasgroup>
</updates>
</layout>
</frontend>
</config>
and file name AttributesAsGroup.xml change to attributesasgroup.xml
以及此代码的代码:
此文件代码为
<layout version="0.1.0">
<catalog_product_view>
<reference name="content">
<block name="product.info" >
<block type="attributesasgroup/groupview" name="product.attributes" as="additional" template="webguys/attributesasgroup/groupview.phtml">
<action method="addToParentGroup"><group>detailed_info</group></action>
</block>
</block>
</reference>
</catalog_product_view>
</layout>