From 8d485032f0041f8a160f9cb414b1d479ccf858c9 Mon Sep 17 00:00:00 2001 From: devansh bawari Date: Mon, 8 Mar 2021 13:42:15 +0530 Subject: [PATCH] Parent Image Added --- packages/Webkul/Product/src/ProductImage.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/Webkul/Product/src/ProductImage.php b/packages/Webkul/Product/src/ProductImage.php index df2fe6699..9050c71de 100644 --- a/packages/Webkul/Product/src/ProductImage.php +++ b/packages/Webkul/Product/src/ProductImage.php @@ -70,6 +70,15 @@ class ProductImage extends AbstractProduct ]; } + /* + * Product parent checked already above. If the case reached here that means the + * parent is available. So recursing the method for getting the parent image if + * images of the child are not found. + */ + if (empty($images)) { + $images = $this->getGalleryImages($product->parent); + } + return $loadedGalleryImages[$product->id] = $images; }