0

I am having some problems with adding files to the admin/sales_order_create/index page in Magento's admin/backend section. The js file is being rendered but twice. This is definitely not being called from anywhere else because if I comment it out from the layout file it's not even rendered once.

The phtml template doesn't render at all but when I put a javascript alert in it for some reason the alert popped up on page load. When this happened I added some markup to see if that would render also but it didn't despite the alert showing.

app/design/adminhtml/default/default/layout/mto.xml

<layout version="0.1.0">
     <adminhtml_sales_order_create_index>
         <reference name="head">
             <action method="addItem">
                 <type>skin_js</type>
                 <name>mto/js/createOrder.js</name>
             </action>
         </reference>
         <reference name="content">
             <block type="adminhtml/template" name="search" template="mto/index.phtml"/>
         </reference>
   </adminhtml_sales_order_create_index>
</layout>

app/design/adminhtml/default/default/template/mto/index.phtml

Any suggestions?

0

I managed to get everything to load as it should (only once) and it all seems to work. I have had difficulty getting the template to render at my chosen part of the page as only one method that I have tried seemed to work but I might be able to do something with javascript.

This is my updated layout file.

<layout version="0.1.0">
<adminhtml_sales_order_create_index>


    <reference name="head">
        <action method="addItem">
            <type>skin_js</type>
            <name>mto/js/jquery-1.11.0.min.js</name>
        </action>
        <action method="addItem">
            <type>skin_js</type>
            <name>mto/js/jquery-ui.min.js</name>
        </action>
        <action method="addItem">
            <type>skin_js</type>
            <name>mto/js/createOrder.js</name>
        </action>


    </reference>

    <reference name="before_body_end">
        <block type="adminhtml/template" name="primaCustomer" template="mto/index.phtml"/>
    </reference>



</adminhtml_sales_order_create_index>

<adminhtml_sales_order_create_load_block_header>

    <reference name="head">
        <action method="addItem">
            <type>skin_js</type>
            <name>mto/js/jquery-1.11.0.min.js</name>
        </action>
        <action method="addItem">
            <type>skin_js</type>
            <name>mto/js/jquery-ui.min.js</name>
        </action>
        <action method="addItem">
            <type>skin_js</type>
            <name>mto/js/createOrder.js</name>
        </action>


    </reference>

    <reference name="before_body_end">
        <block type="adminhtml/template" name="primaCustomer" template="mto/index.phtml"/>
    </reference>

</adminhtml_sales_order_create_load_block_header>
</layout>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.