Skip to content

Commit

Permalink
Merge pull request firegento#59 from latenzio/list_product_plugin_fix
Browse files Browse the repository at this point in the history
fix missing return when block was found and `catalog/frontend/display…
  • Loading branch information
Andreas Mautz authored Nov 2, 2017
2 parents a89faae + 1ad21ae commit d2cc023
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Plugin/Catalog/ListProductPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,20 @@ 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;
} else {
return $result;
$result = $deliveryBlock->toHtml() . $result;
}
}
return $result;
}
}

0 comments on commit d2cc023

Please sign in to comment.