Reputation: 645
I want to override
app\design\adminhtml\default\default\template\catalog\product\edit\options\type\select.phtml
and replace it with my custom module. I was unable to replace the file. I placed my custom file at this location and I created a app\design\adminhtml\default\default\layout\mymodule.xml
file:
<adminhtml>
<layout>
<updates>
<Mycompany_Mymodule>
<file>Mycompany_Mymodule.xml</file>
</Mycompany_Mymodule>
</updates>
</layout>
</adminhtml>
But this did not replace the file. Any ideas on what I should try?
Upvotes: 0
Views: 1923
Reputation: 478
Options I can think of:
Copy over the core template to: app/design/adminhtml/default/default/template/catalog/my_namespace/product/edit/options/type/select.phtml
A. Rewrite the block type: adminhtml/catalog_product_edit_tab_options_type_select, overload the constructor, call setTemplate with your template's path.
OR
B. Hook into core_block_abstract_prepare_layout_before and for that block class call setTemplate with your template's path.
Another option, which I'm not sure is recommended, it's possible to add set the theme for the admin via a module's config.xml:
<stores>
<admin>
<design>
<package>
<name>default</name>
</package>
<theme>
<default>mytheme</default>
</theme>
</design>
</admin>
</stores>
Then you would drop in your modified template into: app/design/adminhtml/default/mytheme/template/catalog/product/edit/options/type/select.phtml.
A note about this approach is that I recall on some versions of magento a community module (the find) which was bundled with magento (not sure if it was just with the enterprise edition) implemented this approach.
Upvotes: 1