Magento: Adding breadcrumbs to Homepage

Posted on September 9th, 2011 | Posted by admin

1.  Register the new module (we will call the module CMS and give the development company the name Acme):

In your “magento\app\etc\modules” directory create a file named Acme_All.xml with the following content:-

<?xml version="1.0"?>

2.  Register the module (which will be implemented in the class
Acme_Cms_Block_Page) as being responsible for rewrite-ing the cms/page
In a “magento\app\code\local\Acme\Cms\etc “directory (you will need to
create it) create a config.xml file with the following content:-

Magento – Layered Navigation Custom

Posted on September 9th, 2011 | Posted by admin

Magento - Layered Navigation Custom

If you want you layered navigation to be customized like the image above follow me…

We need to edit 3 files..

  • styles.css
  • template/catalog/layer/filter.phtml
  • template/catalog/layer/view.phtml


Magento – Add Thumbnail Image in Transaction email

Posted on September 9th, 2011 | Posted by admin

A client requested adding product thumbnail images in the Order Confirmation Email that is sent after a customer order a product.. Without much ado here’s the code…

<?php //added for sending image with order
$product = Mage::getModel(‘catalog/product’)
<p align=”center”><img src=”<?php echo Mage::helper(‘catalog/image’)->init($product, ‘image’)->resize(50); ?>” width=”50″ /></p>

add this snippet below <td align=”left” valign=”top” style=”padding:3px 9px”>

Magento – Display Categories (with category images) in the homepage

Posted on September 9th, 2011 | Posted by admin

$_helper    = $this->helper(‘catalog/output’);
$_category  = $this->getCurrentCategory();
$_imgHtml   = ”;

if ($_imgUrl = $_category->getImageUrl()) {
$_imgHtml = ‘<p><img src=”‘.$_imgUrl.’” /></p>’;
$_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, ‘image’);

<?php // Iterate all categories in store
$limit = 0;
$_helper    = $this->helper(‘catalog/output’);
foreach ($this->getStoreCategories() as $_category):

// If category is Active

// Load the actual category object for this category
$cur_category = Mage::getModel(‘catalog/category’)->load($_category->getId());

if ($_imgUrl = $cur_category->getImageUrl()){

$_imgHtml = ‘<img src=”‘.$_imgUrl.’”  width=”105px” />’;
$_imgHtml = $_helper->categoryAttribute($cur_category, $_imgHtml, ‘image’);
} ?>
<a href=”<?php echo $this->getCategoryUrl($cur_category) ?>” style=”border:none”>
<?php echo $_imgHtml; ?>
<a href=”<?php echo $this->getCategoryUrl($cur_category) ?>”>
<?php echo $_helper->categoryAttribute($cur_category, $cur_category->getName(), ‘name’) ?>

Magento ERROR: unable to unpack

Posted on September 7th, 2011 | Posted by admin

Current issue with PEAR repositories affects upgrade from Magento to Magento via Magento Connect Manager and installation of some Magento extensions. The following error (or similar one) is shown in Magento Connect Manager on installation/upgrade:

ERROR: unable to unpack downloader/pearlib/download/AW_Blog-1.0.21.tgz

To solve the issue it is needed to forcibedly upgrade PEAR package to the latest version using the following CLI command: