Magento无法分配重写报告产品查看块
我只需要创建最近的产品视图滑块。 所以我想从核心文件中覆盖报告、产品和查看的块。 我为此编写了config.xml,但在产品页面上我无法做到这一点。 基本上,我想覆盖报告产品块,并想在其中为最近的产品滑块添加一些代码。 我的config.xml是Magento无法分配重写报告产品查看块,magento,Magento,我只需要创建最近的产品视图滑块。 所以我想从核心文件中覆盖报告、产品和查看的块。 我为此编写了config.xml,但在产品页面上我无法做到这一点。 基本上,我想覆盖报告产品块,并想在其中为最近的产品滑块添加一些代码。 我的config.xml是 ---------------- <?xml version="1.0"?> <config> <modules> <Deepak_Recent&
----------------
<?xml version="1.0"?>
<config>
<modules>
<Deepak_Recent>
<version>0.1.0</version>
</Deepak_Recent>
</modules>
<global>
<blocks>
<recent>
<rewrite>
<reports_product_viewed>Deepak_Recent_Block_Product_Viewed</reports_product_viewed>
</recent>
</catalog>
</blocks>
<helpers>
<recent>
<class>Deepak_Recent_Helper</class>
</recent>
</helpers>
</global>
<frontend>
<routers>
<recent>
<use>standard</use>
<args>
<module>Deepak_Recent</module>
<frontName>recent</frontName>
</args>
</recent>
</routers>
<layout>
<updates>
<recent>
<file>recent.xml</file>
</recent>
</updates>
</layout>
</frontend>
</config>
my rewrite block
-----------------
<?php
class Deepak_Recent_Block_Product_Viewed extends Mage_Reports_Block_Product_Viewed{
public function getme(){ echo 'block loaded';}
}
my layout.xml
---------------
<?xml version="1.0"?>
<layout version="0.1.0">
<catalog_product_view>
<reference name="product.info">
<block type="recent/product" name="product.info.recent" template="carousel/products_recent_horizontal.phtml"/>
</reference>
</catalog_product_view>
</layout>
and alst my phtml file
-----------------
<?php
echo $this->getme();exit;
?>
----------------
0.1.0
Deepak_最近的_Block_产品_查看
Deepak_最近的助手
标准
迪帕克
最近的
recent.xml
我的重写块
-----------------
您的config.xml
文件应该是
<config>
<modules>
<Deepak_Recent>
<version>0.1.0</version>
</Deepak_Recent>
</modules>
<global>
<blocks>
<reports> <!-- Changes here start -->
<rewrite>
<product_viewed>Deepak_Recent_Block_Product_Viewed</product_viewed>
</rewrite>
</reports> <!-- Changes here end -->
</blocks>
<helpers>
<recent>
<class>Deepak_Recent_Helper</class>
</recent>
</helpers>
</global>
<frontend>
<routers>
<recent>
<use>standard</use>
<args>
<module>Deepak_Recent</module>
<frontName>recent</frontName>
</args>
</recent>
</routers>
<layout>
<updates>
<recent>
<file>recent.xml</file>
</recent>
</updates>
</layout>
</frontend>
</config>
0.1.0
Deepak_最近的_Block_产品_查看
Deepak_最近的助手
标准
迪帕克
最近的
recent.xml
事实上,这个问题是在
<blocks>
<reports> <!-- Changes here start -->
<rewrite>
<product_viewed>Deepak_Recent_Block_Product_Viewed</product_viewed>
</rewrite>
</reports> <!-- Changes here end -->
</blocks>
Deepak_最近的_Block_产品_查看
查看答案的顶部…模块标签在配置后关闭..是否正确。。