0

i have tried a lot to get only small image from product collection of product object to create custom XML feed for my products.

but could not able to get succeed yet.

  $imgname = Mage::helper('catalog/image')->init($product, 'small_image',$product->getSmallImage())->resize(200, 115);       

But Result is

http://domainname.com/media/catalog/product/cache/1/small_image/200x115/74bba6f65adf875ca0644363d646988a/images/catalog/product/placeholder/small_image.jpg

And my collection is

$collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')
                 ->addStoreFilter($this->_storeId)                 
                 ->addAttributeToFilter(
                       'status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
                  );

it would be great if some one point me in right direction.

bumped to the homepage by Community 2 days ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

  • as tried lot of small image using helper funtion.It protected prevent the create small image.. for memory limit – Amit Bera Apr 8 '15 at 4:50
  • is there any other which we can grab this ? – liyakat Apr 8 '15 at 5:04
  • no.only solution to create resize image of small_image using varien_image – Amit Bera Apr 8 '15 at 5:20
  • shall we get small_image from base image url if we have ? without load product object. – liyakat Apr 8 '15 at 5:25
  • no. base image will be occur.... Issue with resize image. you can small image directly using below getSmallImageUrl() – Amit Bera Apr 8 '15 at 5:28
0

Try to use catalog output helper

$_helper = $this->helper('catalog/output');
$imgname = $_helper->init($product,
'small_image',$product->getSmallImage())->resize(200, 115);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.