Skip to content

Commit 0a25364

Browse files
author
Vasilii Burlacu
committed
Fixed issue #4468 "Unable to insert multiple catalog product list widgets (with pager) in CMS page"
1 parent f710f9b commit 0a25364

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

app/code/Magento/CatalogWidget/Block/Product/ProductsList.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public function getProductPriceHtml(
198198
? $arguments['display_minimal_price']
199199
: true;
200200

201-
/** @var \Magento\Framework\Pricing\Render $priceRender */
201+
/** @var \Magento\Framework\Pricing\Render $priceRender */
202202
$priceRender = $this->getLayout()->getBlock('product.price.render.default');
203203
if (!$priceRender) {
204204
$priceRender = $this->getLayout()->createBlock(
@@ -347,7 +347,7 @@ public function getPagerHtml()
347347
if (!$this->pager) {
348348
$this->pager = $this->getLayout()->createBlock(
349349
\Magento\Catalog\Block\Product\Widget\Html\Pager::class,
350-
'widget.products.list.pager'
350+
$this->getWidgetPagerBlockName()
351351
);
352352

353353
$this->pager->setUseContainer(true)
@@ -408,4 +408,19 @@ private function getPriceCurrency()
408408
}
409409
return $this->priceCurrency;
410410
}
411+
412+
/**
413+
* @return string
414+
*/
415+
private function getWidgetPagerBlockName()
416+
{
417+
$pageName = $this->getData('page_var_name');
418+
$pagerBlockName = 'widget.products.list.pager';
419+
420+
if (!$pageName) {
421+
return $pagerBlockName;
422+
}
423+
424+
return $pagerBlockName . '.' . $pageName;
425+
}
411426
}

0 commit comments

Comments
 (0)