Skip to content
This repository has been archived by the owner on Jun 1, 2018. It is now read-only.

Commit

Permalink
Added support for grouped product with image on the simple products i…
Browse files Browse the repository at this point in the history
…n stead of the parent.
  • Loading branch information
Santiagoebizmarts committed Oct 21, 2016
1 parent 91c2b25 commit 350e993
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,22 @@ public function getImage($_item)
$product = Mage::getModel('catalog/product')
->load($_item->getProductId());
$imageUrl = $product->getThumbnailUrl();
if ($product->getImage() == "no_selection" && $product->getTypeId() == "configurable") {
if ($product->getImage() == "no_selection" && $product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
$conf = Mage::getModel('catalog/product_type_configurable')->setProduct($product);
$simpleCollection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();
foreach ($simpleCollection as $simpleProduct) {
if ($simpleProduct->getImage() != "no_selection") {
$imageUrl = $simpleProduct->getThumbnailUrl();
}
}
} elseif ($product->getImage() == "no_selection" && $product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_GROUPED) {
$associatedProducts = $product->getTypeInstance(true)->getAssociatedProducts($product);
foreach ($associatedProducts as $simpleProduct) {
if ($simpleProduct->getImage() != "no_selection") {
$imageUrl = $simpleProduct->getThumbnailUrl();
}
}
}
return $imageUrl;
}

}
2 changes: 1 addition & 1 deletion app/code/community/Ebizmarts/AbandonedCart/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<config>
<modules>
<Ebizmarts_AbandonedCart>
<version>1.2.3.1</version>
<version>1.2.4</version>
</Ebizmarts_AbandonedCart>
</modules>
<global>
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ebizmarts/MageMonkey/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<config>
<modules>
<Ebizmarts_MageMonkey>
<version>1.2.6.4</version>
<version>1.2.7</version>
</Ebizmarts_MageMonkey>
</modules>
<global>
Expand Down
2 changes: 1 addition & 1 deletion app/code/community/Ebizmarts/Mandrill/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config>
<modules>
<Ebizmarts_Mandrill>
<version>2.0.12.1</version>
<version>2.0.13</version>
</Ebizmarts_Mandrill>
</modules>
<global>
Expand Down

0 comments on commit 350e993

Please sign in to comment.