How to get a product's image in Magento?

magento

Solution

echo $_product->getImageUrl();

This method of the Product class should do the trick for you.

Problem

I'm running on version 1.3.2.1, but on my client's server they had Magento 1.3.0 so my previous code to display images for my local copy, ``` echo $this->helper('catalog/image')->init($_product)->resize(163, 100); ``` , does not work on the client's installation. Looking at the results returned by their Magento, version 1.3.0 actually returns a URL although it points to the skin's media folder. Is there a way to get the absolute image path for the image? Or should I make changes somewhere else that would tell Magento that the media directory should be on the root?

Original source