How can i get the product base-image without loading the whole product object ? I have product-id,sku.[I know we can get product base image from product object]

Is there any best method or trick available for that ?

Any help will be appreciated.

Thank you

2 Answers 2


You can use this code:

$model = Mage::getResourceModel('catalog/product');
$img = $model->getAttributeRawValue($productId, 'image', $storeId);

For "Small image" use small_image and for "Thumbnail" thumbnail. Similar question was posted here.

  • good try... ) ..
    – Amit Bera
    Commented Jun 16, 2015 at 19:16

In this case you use afterload() function.

  • First load product by loadByAttribute() ,which does not load full image.It take data from product collection

  • then using afterLoad() and using image backend models of base image attribute you can get image easily

    $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);
    $attributes = $product->getTypeInstance(true)->getSetAttributes($product);
        $image = $attributes['image'];
        $backend = $image->getBackend();
       echo  $Theimage = $product->getImage();

Anther example is :

Faster way to load media images in a product collection

  • Thanks amit for answer but i don't want to load product,,,is there any trick or sql query to check product base image?
    – Keyur Shah
    Commented Jun 16, 2015 at 19:02
  • i will see ..... and you have put down vote...
    – Amit Bera
    Commented Jun 16, 2015 at 19:05
  • no amit i didn't do that,,,and i will never put down your vote ,,because i know the your valuable contribution,,,But still +1 from me
    – Keyur Shah
    Commented Jun 16, 2015 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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