Magento overriding the email header and footer - magento

I am working on new Magento project. Basically I want to modify Magento's default email header/footer.
I have noticed that one question posted related to this, but it doesn't seems to be properly answered.
I have added my code below
app/code/local/Toystore/Common/etc/config.xml
<config>
<modules.............>
.......................
</modules>
<global>
<helpers>
...............................
</helpers>
<template>
<email>
<design_email_header2 translate="label" module="toystore_common">
<label>Email - Header</label>
<file>html/headercustom.html</file>
<type>text</type>
</design_email_header2>
<design_email_footer2 translate="label" module="toystore_common">
<label>Email - Footer</label>
<file>html/footercustom.html</file>
<type>text</type>
</design_email_footer2>
</email>
</template>
</global>
</config>
And in my template I have added like following to call this
{{template config_path="design/email/header2"}}
And my html files resides in
app/locale/en_US/template/email/html/headercustom.html
I am not sure why its not calling my new file, because the email is coming without header.
Please advise

You just need to edit the config at System > Configurations > Visual > Transactional Emails

Related

My custom CMS Layout Template in Magento is not loaded

I have created custom CMS layout for Magento according this tutorial. On my localhost(XAMPP on Win7) it is working, but when I have uploaded all 3 files to my web:
app/code/local/Lorinc/cmsLayout/etc/config.xml
app/design/frontend/sportsfans01/default/template/page/cmsLayout.phtml
app/etc/modules/Lorinc_cmsLayout.xml
And it is not working there.
Here is the code of config.xml
<?xml version="1.0"?>
<config>
<modules>
<Lorinc_cmsLayout>
<version>0.1.0</version>
</Lorinc_cmsLayout>
</modules>
<global>
<page>
<layouts>
<cmsLayout translate="label">
<label>cmsLayout</label>
<template>page/cmsLayout.phtml</template>
<layout_handle>cmsLayout</layout_handle>
</cmsLayout>
<!-- add more layouts here -->
</layouts>
</page>
</global>
</config>
And here is Lorinc_cmsLayout.xml
<?xml version="1.0"?>
<config>
<modules>
<Lorinc_cmsLayout>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Page />
</depends>
</Lorinc_cmsLayout>
</modules>
</config>
I have tried everything. I have changed files and folder permissions (files 0644, folders 0755), i have used magento-cleanup.php, my cache is disabled, I have tried to logout and login again and nothing works. Any ideas what is wrong there?
just looked at your question and the first thing I saw is that you have a wrong folder structure:
The path app/design/frontend/sportsfans01/default/template/page/cmsLayout.phtml
has to be changed to
app/design/frontend/default/sportsfans01/template/page/cmsLayout.phtml
Don't know if its just a typo of yours!
Furthermore you could check the logs of magento:
var/log/exception.log
var/log/system.log
Hope this will help
Regards
Vince
Please try this. I found it in App/code/core/Mage/Page/etc/config.xml for the 1column.phtml layout
<global>
<page>
<layouts>
<cmsLayout module="page" translate="label">
<label>cmsLayout</label>
<template>page/cmsLayout.phtml</template>
<layout_handle>page_cmsLayout</layout_handle>
</cmsLayout>
<!-- add more layouts here -->
</layouts>
</page>
</global>
If this won't help please try with changing different theme folder.Be sure to avoid typo mistake.
Problem finally solved. I already had one custom layout (called HomeLayout) on that page so I just merged that 2 layouts. Here is the code of app/code/local/Lorinc/HomeLayout/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Lorinc_HomeLayout>
<version>0.1.0</version>
</Lorinc_HomeLayout>
</modules>
<global>
<page>
<layouts>
<Lorinc_HomeLayout translate="label">
<label>HomeLayout</label>
<template>page/HomeLayout.phtml</template>
<layout_handle>HomeLayout</layout_handle>
</Lorinc_HomeLayout>
<Lorinc_cmsLayout translate="label">
<label>cmsLayout</label>
<template>page/cmsLayout.phtml</template>
<layout_handle>cmsLayout</layout_handle>
</Lorinc_cmsLayout>
<!-- add more layouts here -->
</layouts>
</page>
</global>
</config>
And it works perfect.

Magento not showing Custom Template Page content

I have created 4 CMS Page templates to use for non-product content. I have uploaded the template files to:
app/design/frontend/default/MYTHEME/template/page/ dir. The files I have uploaded are copies of the existing 1column.phtml file, but when I choose that page template from the Design->Layout pulldown menu and try to preview the page I get a blank page, no error, nothing. If I select the 1column page option the content shows properly.
Here is my config file
code/local/FL/CorporateTemplates/etc/config.xml
<?xml version="1.0"?>
<config>
<global>
<page>
<layouts>
<corporate_template_lithograph>
<label>Corporate Template - Lithograph</label>
<template>page/corp-lithograph.phtml</template>
</corporate_template_lithograph>
<corporate_template_wideformat>
<label>Corporate Template - Wide Format</label>
<template>page/corp-wideformat.phtml</template>
</corporate_template_wideformat>
<corporate_template_packaging>
<label>Corporate Template - Packaging</label>
<template>page/corp-packaging.phtml</template>
</corporate_template_packaging>
<corporate_template_photography>
<label>Corporate Template - Photography</label>
<template>page/corp-photograph.phtml</template>
</corporate_template_photography>
</layouts>
</page>
</global>
</config>
Here is my etc/module file
<config>
<modules>
<FL_CorporateTemplates>
<active>true</active>
<codePool>local</codePool>
</FL_CorporateTemplates>
</modules>
</config>
You need to define a layout_handle for each:
<global>
<!-- snip -->
<page>
<layouts>
<corporate_template_lithograph>
<label>Corporate Template - Lithograph</label>
<template>page/corp-lithograph.phtml</template>
<layout_handle>corporate_template_lithograph</layout_handle> <!-- arbitrary value -->
</corporate_template_lithograph>
<layouts>
<page>
<global>
That allows you to define the layout update which will be used in conjunction with this page layout setting in your module's layout XML file. See app/design/frontend/base/default/layout/page.xml for examples.

Custom menu gives 404 in magento on server

I created a custom menu in admin tab in magento admin. It was working perfectly on localhost, but when i deployed my code on the server, it is giving a 404 page not found error. What can be the issue there!
<?xml version="1.0"?>
<config>
<modules>
<Inchoo_CoffeeFreak>
<version>0.1.0</version>
</Inchoo_CoffeeFreak>
</modules>
<global>
<blocks>
<coffefreakblock1>
<class>Inchoo_CoffeeFreak_Block</class>
</coffefreakblock1>
<coffefreakblock2>
<class>Inchoo_CoffeeFreak_Block_EditSpecial</class>
</coffefreakblock2>
</blocks>
<helpers>
<coffefreakhelper1>
<class>Inchoo_CoffeeFreak_Helper</class>
</coffefreakhelper1>
</helpers>
</global>
<admin>
<routers>
<samplerouter1>
<use>admin</use>
<args>
<module>Inchoo_CoffeeFreak_AdminControllersHere</module>
<frontName>print</frontName>
<modules>
<sintax after="Inchoo_CoffeeFreak_AdminControllersHere">Mage_Adminhtml</sintax>
</modules>
</args>
</samplerouter1>
</routers>
</admin>
<adminhtml>
<menu>
<mymenu1 translate="title" module="coffefreakhelper1">
<title>PrintInfo</title>
<sort_order>20</sort_order>
<children>
<!-- Note the misleading "module" attribute.
It actualy refers to one of the declared helpers -->
<myitem1 translate="title" module="coffefreakhelper1">
<title>Add/Change Config</title>
<action>samplerouter1/settings</action>
<sort_order>1</sort_order>
</myitem1>
</children>
</mymenu1>
</menu>
</adminhtml>
</config>
Your server may be running on Linux which is case sensitive so you need to check that you module file and folder should be according Magento standard like controller should be IndexController not indexController etc.
and your localhost running on window which is not case sensitive.
Normally this is when you are logged in. Logout and login again. Then it should work.
Assuming that cache is turn off / cleared
1) Logout and log back in again
If you still getting a 404 error
2) Check your server error log, you maybe missing your module helper file
Login In/Out,clear cache, should be the solution.But you can try below points (though it may find foolish).
1) Check your xml contents.(line by line with your localhost xml)
2) Spellings matter (hope <sintax> spelling is correct is your xml )
3) Remove unwanted space (like before <global> tag) and comments.
4) Opening & closing of tags.
5) Proper Indentation (this will help to find your flaw if it is there)
6) Atlast directly copy the same localhost xml file in your server.
I really wish this will help you to find the bug.

Magento Change Tab Order in Edit Product Section

I want to change order of tabs in edit product section.For example,categories and inventory tab must be swapped.Overriding Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs block doesn't seem to work.
config.xml
<config>
<global>
<blocks>
<my_module>
<class>Company_Adminhtml_Block</class>
</my_module>
<adminhtml>
<rewrite>
<catalog_product_edit_tabs>Company_Adminhtml_Block_Catalog_Product_Edit_Tabs</catalog_product_edit_tabs>
</rewrite>
</adminhtml>
</blocks>
<global>
</config>
I copied Company_Adminhtml_Block_Catalog_Product_Edit_Tabs into local folder and swapped the category and inventory addTab code.Any pointers?
Make sure you have configured your module correctly. To do this, you can simply call from a controller action.
echo get_class(Mage::getBlockSingleton('adminhtml/catalog_product_edit_tabs'));
It should return Company_Adminhtml_Block_Catalog_Product_Edit_Tabs if you configuration is correct, or Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs if your configuration is failed.
Had the same issue. Flushing the cache helped.

Magento Module for new CMS layout, but in version 1.7.0.2

I'm trying to simply create a new layout option for a CMS page in Magento. I've followed the instructions here on the Magento wiki to create a module and it does not work. When I make the same addition to the actual core config.xml file, it works fine, but not as a custom module. Based on some research it looks like this would have worked in Magento 1.6, but does not work on 1.7, I'm trying to figure out why. I have the following:
app/etc/modules/Fruit_Banana.xml
<?xml version="1.0"?>
<config>
<modules>
<Fruit_Banana>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Page />
</depends>
</Fruit_Banana>
</modules>
</config>
app/code/local/Fruit/Banana/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Fruit_Banana>
<version>0.1.0</version>
</Fruit_Banana>
</modules>
<global>
<page>
<layouts>
<homepage_middle translate="label">
<label>Homepage</label>
<template>page/homepage.phtml</template>
<layout_handle>homepage_one</layout_handle>
</homepage_middle>
<!-- add more layouts here -->
</layouts>
</page>
</global>
</config>
Any ideas why it doesn't seem to be working as a module? I am using version 1.7.0.2
The local modules should be in the code directory
app/code/local/Fruit/Banana/etc/config.xml
and not in the core directory as you mentioned
app/code/core/local/Fruit/Banana/etc/config.xml
Well seems like I messed up! It does in fact work in 1.7, my problem was I had the filename for config.xml spelled confix.xml
Once I adjusted that, the custom layout popped right up! Thanks to those that chimed in.

Resources