Resizing Images
<?php
/**
* Overridden product meta data model.
* This model is used as the data source when generating the tagging elements
* on the product page, and when making server-to-server API calls to Nosto.
*/
class My_Nosto_Model_Meta_Product extends Nosto_Tagging_Model_Meta_Product
{
/**
* @inheritdoc
*/
public function loadData(Mage_Catalog_Model_Product $product, Mage_Core_Model_Store $store = null)
{
parent::loadData($product, $store);
$height = 300;
$width = 200;
$image = (string)Mage::helper('catalog/image')
->init($product, 'thumbnail')
->resize($height, $width);
$this->setImageUrl($image);
return true;
}
}Last updated