magento - images from the configurable product using in the simple product

magento - images from the configurable product using in the simple product

August 16, 2026 · Illustrated author avatarBy Stefan Bogdanescu
magento - images from the configurable product using in the simple product

Resolving Image Display Issues for Configurable Products in Magento

Dear Magento developer,

I understand your challenge in displaying images for simple products associated with configurable products in your store. You want to show thumbnail images for these products, especially for use in the sales order screen and new order emails.

The Current Challenge: Missing Images for Simple Products

Your existing code works well for standard simple products:

<?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>

However, when dealing with simple products linked to a configurable product, the images do not propagate down to the child (simple) products. Only the configurable product itself retains its image.

Displaying Configurable Product Images for Associated Simple Products

To resolve this issue, you need to modify your approach slightly:

  1. Instead of loading the specific product ID with load($_item->getProductId()), load the parent configurable product.
  2. Use the parent’s small image for the simple product.

Here’s how you can achieve this:

<?php //modified code for sending image with order
$parentSKU = Mage::getModel('catalog/product')->getResource()->getParentIdsByProduct($_item->getProductId(), true, 'parent_sku');
if (!empty($parentSKU)) {
    $parentID = Mage::getModel('catalog/product')->getIdBySku($parentSKU[0]);
    $parentProduct = Mage::getModel('catalog/product')->setStoreId($_item->getOrder()->getStoreId())->load($parentID);

    if ($parentProduct) {
        echo '<p align="center"><img src="' . Mage::helper('catalog/image')->init($parentProduct, 'small_image')->resize(135) . '" width="135" height="135" alt="" /></p>';
    }
}

In this modified code:

  • We first identify the parent SKU of the current simple product.
  • If a parent exists (which should be the case for products associated with a configurable product), we load the parent product using its ID.
  • We then initialize and display the small image from the parent product.

Conclusion and Further Reading

Displaying images correctly in Magento, especially for complex product types like configurable products, often requires some additional logic. The key is to understand how Magento links simple and configurable products internally.

For more advanced customizations in Magento, I recommend checking out Laravel Company’s Magento development services, where our team specializes in complex integrations and custom solutions.

Remember, always backup your data before making significant changes to your core Magento files. If you’re uncomfortable with this level of modification, consider consulting a professional developer or reaching out to Magento’s official support channels.

Happy coding!

Catalog Configuration Email Orders

Our network