From db0a634edf540e9ed04972094ef6e6d28e684f93 Mon Sep 17 00:00:00 2001 From: Kostadin Bashev Date: Fri, 15 Mar 2024 02:48:20 +0200 Subject: [PATCH] get parent url if is available. --- app/code/Meta/Catalog/Model/Product/Feed/Builder.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/code/Meta/Catalog/Model/Product/Feed/Builder.php b/app/code/Meta/Catalog/Model/Product/Feed/Builder.php index 6e045623..446ebdf1 100644 --- a/app/code/Meta/Catalog/Model/Product/Feed/Builder.php +++ b/app/code/Meta/Catalog/Model/Product/Feed/Builder.php @@ -261,9 +261,7 @@ private function getProductUrl(Product $product) ? $product->getData($this->attrMap[self::ATTR_URL]) : null; if ($link == '' || $link == null) { - $parentUrl = $product->getParentProductUrl(); - // use parent product URL if a simple product has a parent and is not visible individually - $url = (!$product->isVisibleInSiteVisibility() && $parentUrl) ? $parentUrl : $product->getProductUrl(); + $url = $product->getParentProductUrl() ?: $product->getProductUrl(); return $this->builderTools->replaceLocalUrlWithDummyUrl($url); } else { return $this->trimAttribute(self::ATTR_URL, $link);