Every now and then, you might end up with a custom image type in your Magento store. Maybe the initial ones don’t allow enough flexibilty or you need to show a specific image somewhere about som aspect of your product?
I had this exact issue recently where I needed to store a colour swatch for a product and load it on a specific page.
The code for this is actually nice and straight forward:
1 2 3 |
if ($_helper->productAttribute($child, $child->getColourSwatch(), 'colour_swatch') != 'no_selection' ) { echo '<img src="' . $this-/>helper('catalog/image')->init($child, 'colour_swatch')->resize(163, 100) . '" />'; } |
Image Credit: kevin dooley
Comment or tweet @douglasradburn