Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/code/Magento/Catalog/Helper/Product/ProductList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Comment on lines +129 to +132

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$scope=ScopeInterface::SCOPE_STORE;
if($this->scopeConfig->getValue('general/single_store_mode/enabled', ScopeConfigInterface::SCOPE_TYPE_DEFAULT)) {
$scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT;
}
$scope = $this->scopeConfig->getValue(\Magento\Store\Model\StoreManager::XML_PATH_SINGLE_STORE_MODE_ENABLED)
? ScopeConfigInterface::SCOPE_TYPE_DEFAULT
: ScopeInterface::SCOPE_STORE;

$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;
Expand Down