I'm trying to get all the product images of all the products in the shopping cart. I've used the following code:
$_item = $this->getItem();
$_product = Mage::getModel('catalog/product')->load($_item->getProductId());
foreach ($_product->getMediaGalleryImages() as $image) {
echo var_export($image->getUrl());
echo "<br>";
}
But this only displays all the images of the first produuct in the shopping cart. I've tried it this way:
foreach ($this->getMediaGalleryImages() as $image) {
echo var_export($image->getUrl());
echo "<br>";
}
But this doesn't return anything. How can I get all the images of all the products?