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);
}

Wednesday, August 31, 2011

Magento: WYSIWYG Editor Wraps Content in P Tags

Version: Magento 1.x

Problem:

The WYSIWYG editor wraps content in p tags even when switching to html view and manually deleting them.

Hack Fix:

Change the p tags to div tags in html view.

Friday, July 15, 2011

Mobile Devices Display Generic ASPDNSF Store Instead of the Actual Website

Version: ASPDotNetStorefront 9.x

Problem:
When browsing the site with a mobile or table device the default generic mobile skin is being displayed.

Solution:
To disable the mobile skin and display the standard website skin, delete all rows in the MobileDevice table.

Thursday, July 14, 2011

Magento: Change Base URL via Database

Version: Magento 1.x

Problem:
Changing the base url in Magento admin (System –> Configuration –> Web –> Base URL) causes an error and the front-end and back-end no longer display.

Solution:
In table, core_config_data update rows:
web/unsecure/base_url = your new domain
web/secure/base_url = your new domain

Clear cache by deleting all files in the folder: /var/cache/