Skip to content

Commit

Permalink
ENGCOM-2064: [Forwardport] Variant product image in sidebar wishlist …
Browse files Browse the repository at this point in the history
…block #15698
  • Loading branch information
Stanislav Idolov authored Jun 21, 2018
2 parents 6b168c5 + 67d2dc2 commit 51d838c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/code/Magento/Wishlist/CustomerData/Wishlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ protected function getItemData(\Magento\Wishlist\Model\Item $wishlistItem)
*/
protected function getImageData($product)
{
/*Set variant product if it is configurable product.
It will show variant product image in sidebar instead of configurable product image.*/
$simpleOption = $product->getCustomOption('simple_product');
if ($simpleOption !== null) {
$optionProduct = $simpleOption->getProduct();
$product = $optionProduct;
}

/** @var \Magento\Catalog\Helper\Image $helper */
$helper = $this->imageHelperFactory->create()
->init($product, 'wishlist_sidebar_block');
Expand Down

0 comments on commit 51d838c

Please sign in to comment.