Change background color of images in magento

I found the following solution for changing the background color of images. I have overwritten the Catalog/Helper/Image class, so the background color is changed in the whole theme and it isn’t necessary to overwrite the template files.

Create a class in app/code/local/Foo/Catalog/Helper/Image.php

class Foo_Catalog_Helper_Image extends Mage_Catalog_Helper_Image {
	public function init(Mage_Catalog_Model_Product $product,$attributeName,$imageFile = null) {
		return $this;

Overwriting the helper class in the app/code/local/Foo/Bar/etc/config.xml

<?xml version="1.0"?>

Sven Wappler

TYPO3 Experte, symfony, Magento, SEO, Frontend und Backend

Das könnte Dich auch interessieren …

Schreibe einen Kommentar