Skip to content

Commit 67d2dc2

Browse files
ENGCOM-2064: [Forwardport] Variant product image in sidebar wishlist block #15698
- Merge Pull Request #15698 from dmytro-ch/magento2:2.3-develop-PR-port-15477 - Merged commits: 1. eea948d 2. fb913ad
2 parents e47b0d7 + fb913ad commit 67d2dc2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/code/Magento/Wishlist/CustomerData/Wishlist.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ protected function getItemData(\Magento\Wishlist\Model\Item $wishlistItem)
149149
*/
150150
protected function getImageData($product)
151151
{
152+
/*Set variant product if it is configurable product.
153+
It will show variant product image in sidebar instead of configurable product image.*/
154+
$simpleOption = $product->getCustomOption('simple_product');
155+
if ($simpleOption !== null) {
156+
$optionProduct = $simpleOption->getProduct();
157+
$product = $optionProduct;
158+
}
159+
152160
/** @var \Magento\Catalog\Helper\Image $helper */
153161
$helper = $this->imageHelperFactory->create()
154162
->init($product, 'wishlist_sidebar_block');

0 commit comments

Comments
 (0)