简体   繁体   English

我试图通过xml加载phtml文件以在magento中添加退款选项卡?

[英]Im trying to load phtml file via xml for added refund tab in magento?

Im trying to load an file sales/guest/form.phtml for added tab left navigation tab on customer my account, via customer.xml but didn't kindly help me. 我试图加载文件sales / guest / form.phtml以通过customer.xml在我的客户帐户上添加添加的选项卡左导航选项卡,但并没有帮助我。 Refund 退款

I have done somewhat similar in my old project. 我在以前的项目中做过一些类似的事情。 here is what i do : 这是我的工作:

Added a new link in My Account section from customers.xml ie 在customers.xml的“我的帐户”部分添加了新链接,即

<action method="addLink" translate="label" module="preorder"><name>Previous_Orders</name><path>preorder/index/</path><label>Previous Orders</label></action>

In your case you can use an already running module instead of preorder and change the name in above action. 在您的情况下,可以使用已经运行的模块而不是预购模块,并在上述操作中更改名称。

In module/contollers/IndexController.php add a view as follows : 在module / contollers / IndexController.php中添加如下视图:

public function viewAction()
    {
        $this->loadLayout();     
        $this->renderLayout();
    }

Add preorder/preorder.phtml template folder in your theme template folder. 在主题模板文件夹中添加preorder / preorder.phtml模板文件夹。

in your theme layout folder add preorder.xml as follows: 在主题布局文件夹中,添加preorder.xml,如下所示:

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
    </default>
    <preorder_index_index>
        <label>Customer My Account Previous Orders</label>
        <update handle="customer_account"/>
        <reference name="content">
            <block type="preorder/preorder" name="preorder" template="preorder/preorder.phtml" />

        </reference>
    </preorder_index_index>
</layout> 

Hope you ot the idea, what we have done is created a new module which loads the template on index action, you cn change the name of module "preorder" and also the action "index" while working on this. 希望您能想到这一点,我们已经完成了创建一个新模块的工作,该模块将在索引操作上加载模板,您可以在执行此操作时更改模块“ preorder”的名称以及操作“ index”。

I was very brief while writing this, Hope this helps you in someway. 我在撰写本文时非常简短,希望这对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM