From 4b62e3d6df8652bb833a39118d3dcfec5153c003 Mon Sep 17 00:00:00 2001 From: Enrico Thies Date: Tue, 10 Jan 2017 09:13:57 +0100 Subject: [PATCH] fix missing return when block was found and `catalog/frontend/display_delivery_time` is `0` --- Plugin/Catalog/ListProductPlugin.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Plugin/Catalog/ListProductPlugin.php b/Plugin/Catalog/ListProductPlugin.php index 21be813..39b7782 100644 --- a/Plugin/Catalog/ListProductPlugin.php +++ b/Plugin/Catalog/ListProductPlugin.php @@ -33,21 +33,21 @@ public function aroundGetProductDetailsHtml( \Closure $proceed, \Magento\Catalog\Model\Product $product) { + $result = $proceed($product); + $deliveryBlock = $subject->getLayout()->getBlock('product.info.delivery'); - // Carry on with the default processing chain if the block does not exist. - if (!$deliveryBlock) { - return $proceed($product); - } + if ($deliveryBlock) { + $deliveryBlock->setProduct($product); - $deliveryBlock->setProduct($product); - $result = $proceed($product); - if ((bool)$this->_scopeConfig->getValue( + if ((bool) $this->_scopeConfig->getValue( 'catalog/frontend/display_delivery_time', \Magento\Store\Model\ScopeInterface::SCOPE_STORE )) { -; - return $deliveryBlock->toHtml() . $result; + $result = $deliveryBlock->toHtml() . $result; + } } + + return $result; } }