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?
All the images are stored under the pub/media/catalog/product folder in the Magento root. If the product image name is abc. jpg then it's stored under the above folder with an a/b/abc.
Definition of Product Image URL: The Uniform Resource Locator (URL) for the high- resolution product image that clearly depicts the primary selling surface of the product. Retailers should be able to use the image to authenticate the identity of the item.
echo $_product->getImageUrl();
This method of the Product class should do the trick for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With