how can I add a custom product image type in the image gallery?
e.g, see banner_landing
type in the image below.
found a great tutorial for it. I'll paste it here since I didn't find any other reference on SO and might be useful to the community https://www.pixafy.com/blog/2012/12/adding-a-fourth-image-position-to-the-admin-for-a-magento-product/
You need create new install script.
$installer = $this;
$installer->startSetup();
$this->addAttribute('catalog_product','new_image_attribute',
array (
'group' => 'Images',
'type' => 'varchar',
'frontend' => 'catalog/product_attribute_frontend_image',
'label' => 'New Image Attribute',
'input' => 'media_image',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'visible' => true,
'default' => '',
'class' => '',
'source' => ''
)
);
$installer->endSetup();
To use this type of image in your product page, call the image like this:
<?php echo $this->helper('catalog/image')->init($_product, 'new_image_attribute')->resize(400,300); ?>