When a Magento 2 layout XML change does not take effect, first check the active Layout Handles. A layout XML file is processed only when its corresponding handle is active on the page. You can display the current handles directly…
“Reset password” page empty after installing SUPEE-6788 (Magento 1)
If the password reset page is emtpy after you installed the Magento security patch SUPEE-6788, the problem is most likely to be found in the customer.xml file. Open the customer.xml file of your theme and replace customer_account_resetpassword with customer_account_changeforgotten. The…
Password reset page blank after installing SUPEE-6788 (Magento 1)
Is the password reset page blank after installing the SUPEE-6788 patch? The issue is probably in your customer.xml file. Open customer.xml in your theme’s layout directory and replace customer_account_resetpassword with customer_account_changeforgotten. The corresponding block must also be replaced. Replace customer/account_resetpassword…
Removing block from cache (Magento 1)
To remove a certain block from the Magento cache, use the below code.
|
1 2 3 |
<reference name="name.of.the.block"> <action method="setCacheLifetime"><s>null</s></action> </reference> |
Changing the title tag of the home page or any CMS page (Magento 1)
Magento automatically adds the defined suffix to the title tag on every page. If you want to change that for lets say the home page, open the CMS page “home” and add the following XML to the layout section:
|
1 2 3 |
<reference name="head"> <action method="setData"><key>title</key><value>... Title Tag ...</value></action> </reference> |
Removing the breadcrumb navigation on all pages (Magento 1)
Create a local copy of \app\design\frontend\base\default\layout\page.xml and remove or comment the following line:
|
1 |
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/> |
Adding comments to fields in admin area (Magento 1)
It is possible and helpful to add comments to the Magento admin fields. Take a look at the following picture: To add a field and a comment, open your modules system.xml and add the below XML:
|
1 2 3 4 5 6 7 8 9 |
<some_thing translate="label"> <label>Test</label> <frontend_type>text</frontend_type> <sort_order>0</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> <comment>Thats a comment!</comment> <some_thing> |
Making custom options available in quote in admin area (Magento 1)
Sometimes, when adding custom options to a quote in ther admin area, the custom options are not available. To avoid that problem, simply add the custom options to your modules config.xml, like this:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
<global> <sales> <quote> <item> <product_attributes> <custom_product_attribute1/> <custom_product_attribute2/> </product_attributes> </item> </quote> </sales> </global> |
Getting the front name of a route programmatically (Magento 1)
Use the ollowing code to get a routes front name:
|
1 2 |
// will display "config" $frontName = (string)Mage::getConfig()->getNode('frontend/routers/whatever/args/frontName'); |
The code will return “config”, if you add the following XML to your modules config.xml:
|
1 2 3 4 5 6 7 8 9 10 11 |
<frontend> <routers> <whatever> <use>standard</use> <args> <module>Company_Module</module> <frontName>config</frontName> </args> </whatever> </routers> </frontend> |