I downloaded a script to create a CSV datafeed of my products and I would also like to include a url to the thumbnail. The code already has the following for the product image url:
$product_data['ImageURL']=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'catalog/product'.$product->getImage();
So I tried to adjust this to:
$product_data['ThumbnailURL']=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'catalog/product'.$product->getThumbnail();
Which displays exactly the same image url (not the thumb). How would I fix this?
I did a var_dump($product); and the result was:
["image"]=> string(18) "/f/i/file_2_18.png" ["small_image"]=> string(18) "/f/i/file_2_18.png" ["thumbnail"]=> string(18) "/f/i/file_2_18.png"
I also need to get the subcategory for the product but I don’t know how to call this. How can I see which variables are possible? E.g. $product->getPrice or $product->getName?
I recently needed to do this as well… here’s how I got to it:
Or another example
You should use the catalog product media config model for this purpose.
Edit After your comment.
Update Answer
See below URL
Make all store images the base, small and thumbnail images in Magento?
Try it
Hope that helps you!