Thursday, September 29, 2011

Magento: There has been an error processing your request

Version: Magento 1.5+

Problem:

By default, Magento does not show detailed error messages and shows an error log number only.  For example,

Magento Commerce
There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: 1816309327
Magento is a trademark of Magento Inc. Copyright © 2010 Magento Inc.

Solution:

Magento does not show verbose error messages by default for security reasons.

Full error details can be found in the /var/report/ directory.  Look for a filename that matches the error log record number in the error summary.

To enable verbose errors, rename the following file: /errors/local.xml.sample –> /errors/local.xml

Magento: Change Database Connection Credentials

Version: Magento 1.x

Problem:

Change database connection credentials to point to new database.

Solution:

Modify the connection section in: app/etc/local.xml

Sunday, September 4, 2011

Mangento: Create a New Structural Block Using Local.xml

Version: Magento 1.x

Problem:
Create a new structural block without making changes to default theme layout files e.g. page.xml.

Solution:
Add the following to local.XML to create a new structural block with name “newblock”.

<layout version="0.1.0">
    <default>
        <reference name="root">
            <block type="core/text_list" name="after_head_start"/>
        </reference>
    </default>
</layout>

Add content blocks as normal and render the structural block (as standard) in .phtml files e.g.
<?php echo $this->getChildHtml('newblock') ?>

Saturday, September 3, 2011

Magento: Use PIE for IE6-8 CSS3 Decoration Features

Version: Magento 1.x
Problem:
Make IE6-8 recognize useful CSS3 decoration features. e.g. rounded corners.
Solution:
Install third party solution PIE as follows:
  1. Download latest PIE version: http://css3pie.com
  2. Copy PIE.htc to /skin/frontend/yourdesignpackage/yourtheme/css/ (in fact your can copy it to any location you like).
When specifying CSS3 styles in your stylesheet – include the behavior property with the full url to the .htc file.  For example:
.rounded-corner {
    border: 5px solid #d8d7cd;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    behavior: url(/skin/frontend/yourdesignpackage/yourtheme/css/PIE.htc);
}