diff --git a/app/code/Magento/Theme/Block/Html/Pager.php b/app/code/Magento/Theme/Block/Html/Pager.php
index bb67af11ba6ca..74d9b3d2cfa2b 100644
--- a/app/code/Magento/Theme/Block/Html/Pager.php
+++ b/app/code/Magento/Theme/Block/Html/Pager.php
@@ -95,6 +95,13 @@ class Pager extends \Magento\Framework\View\Element\Template
*/
protected $_frameEnd;
+ /**
+ * Url Fragment for pagination
+ *
+ * @var string|null
+ */
+ protected $_fragment = null;
+
/**
* Set pager data
*
@@ -246,11 +253,12 @@ public function getLimitVarName()
* Set pager limit
*
* @param array $limits
- * @return void
+ * @return $this
*/
public function setAvailableLimit(array $limits)
{
$this->_availableLimit = $limits;
+ return $this;
}
/**
@@ -435,6 +443,7 @@ public function getPagerUrl($params = [])
$urlParams['_current'] = true;
$urlParams['_escape'] = true;
$urlParams['_use_rewrite'] = true;
+ $urlParams['_fragment'] = $this->getFragment();
$urlParams['_query'] = $params;
return $this->getUrl('*/*/*', $urlParams);
@@ -740,4 +749,26 @@ protected function _toHtml()
}
return '';
}
+
+ /**
+ * get the url fragment
+ *
+ * @return string|null
+ */
+ public function getFragment()
+ {
+ return $this->_fragment;
+ }
+
+ /**
+ * set the url fragment
+ * @param $fragment
+ *
+ * @return $this
+ */
+ public function setFragment($fragment)
+ {
+ $this->_fragment = $fragment;
+ return $this;
+ }
}