From 96141944d83e161f02eb6d49d5dc1ae920ebe2e0 Mon Sep 17 00:00:00 2001 From: "gitlab.magecomp" Date: Sat, 10 Oct 2020 10:30:32 +0530 Subject: [PATCH] magento/magento2#25933 : Single Store Mode- Incorrect scope values using at Storefront for Catalog Section --- app/code/Magento/Catalog/Helper/Product/ProductList.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Helper/Product/ProductList.php b/app/code/Magento/Catalog/Helper/Product/ProductList.php index 9f976654d9676..e2dae91477599 100644 --- a/app/code/Magento/Catalog/Helper/Product/ProductList.php +++ b/app/code/Magento/Catalog/Helper/Product/ProductList.php @@ -126,12 +126,15 @@ public function getAvailableLimit($viewMode): array if (!isset($availableViewModes[$viewMode])) { return $this->_defaultAvailableLimit; } - + $scope=ScopeInterface::SCOPE_STORE; + if($this->scopeConfig->getValue('general/single_store_mode/enabled', ScopeConfigInterface::SCOPE_TYPE_DEFAULT)) { + $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT; + } $perPageConfigPath = 'catalog/frontend/' . $viewMode . '_per_page_values'; - $perPageValues = (string)$this->scopeConfig->getValue($perPageConfigPath, ScopeInterface::SCOPE_STORE); + $perPageValues = (string)$this->scopeConfig->getValue($perPageConfigPath, $scope); $perPageValues = explode(',', $perPageValues); $perPageValues = array_combine($perPageValues, $perPageValues); - if ($this->scopeConfig->isSetFlag('catalog/frontend/list_allow_all', ScopeInterface::SCOPE_STORE)) { + if ($this->scopeConfig->isSetFlag('catalog/frontend/list_allow_all', $scope)) { return ($perPageValues + ['all' => __('All')]); } else { return $perPageValues;