who can help me solve this puzzle of php code? (for the record, i am not a php programmer)
I want to show a thumbnail (for using in the sales order screen and new order mail)
Simple products aren't the problem. I have this code for this:
<?php //added for sending image with order
$product = Mage::getModel('catalog/product')
->setStoreId($_item->getOrder()->getStoreId())
->load($_item->getProductId()); ?>
<p align="center"><img src="<?php echo Mage::helper('catalog/image')->init($product, 'small_image')->resize(135); ?>" width="135" height="135" alt="" /></p>
This works fine. Where it's getting difficult is when i have a simple product related to a configurable product. The "childs" of the configurable product don't have images included, only the configurable product. (see the screenshot, the first product is the configurable product with the images, the rest are simple products "childs" with no photo's)
With the code above i only see the placeholder of the image. How can i call the image of the configurable product?
I use magento 1.6.2.0 on the dedicated server (running on ubuntu 10.04lts server)