如何复制 Magento 报告?无法更改操作函数名称

发布于 2024-10-12 06:47:18 字数 879 浏览 2 评论 0原文

我试图复制“销售->订单”报告,期间遇到了问题。我尝试将位于 Mage/reports/etc/adminhtml.xml 中名为“salesAction”的销售函数重命名为“sales1Action”

                    <sales translate="title" module="reports">
                        <title>Orders</title>
                        <action>adminhtml/report_sales/sales</action>
                    </sales>

,因此

                    <sales translate="title" module="reports">
                        <title>Orders</title>
                        <action>adminhtml/report_sales/sales1</action>
                    </sales>

我必须将 mage/adminhtml/controllers/report/SalesController.php 中定义的 salesAction 函数重命名为 sales1Action。

完成重命名后,将调用函数 sales1Action,但由于某种原因它不显示报告界面。在我看来,它需要将某些功能或文件从 sales 更改为 sales1 才能使其正常工作。任何人都知道如何做到这一点?

I was trying to duplicate Sales->Orders report during which I had an issue. I tried renaming sales function named 'salesAction' to 'sales1Action' located in Mage/reports/etc/adminhtml.xml

                    <sales translate="title" module="reports">
                        <title>Orders</title>
                        <action>adminhtml/report_sales/sales</action>
                    </sales>

to

                    <sales translate="title" module="reports">
                        <title>Orders</title>
                        <action>adminhtml/report_sales/sales1</action>
                    </sales>

due to which I had to rename salesAction function defined in mage/adminhtml/controllers/report/SalesController.php to sales1Action.

Once I am done with the rename, the function sales1Action is called but for some reason it does not show the report interface. Seems to me like it needs another change in some function or file from sales to sales1 to make it work. Anyone has a clue how to do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蹲墙角沉默 2024-10-19 06:47:18

从这里的另一个帖子得到了答案:

检查文件
应用程序/设计/adminhtml/默认/默认/布局/sales.xml
对于该部分
- 哪个
与请求的 URL 匹配。它有一个
类型块
“adminhtml/report_sales_sales”其中
是一个网格容器,网格容器
自动创建他们的子网格
块。

如果有人遇到类似问题,请参阅以下链接,了解详细信息:
为新管理模块配置 Magento 布局

Got the answer from another post here:

Check the file
app/design/adminhtml/default/default/layout/sales.xml
for the section
- which
matches the requested URL. It has a
block of type
"adminhtml/report_sales_sales" which
is a grid container, grid containers
automatically create their child grid
block.

In case anyone is having similar issue, here is the link with details:
Configuring Magento Layout for New Admin Module

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文