Skip to content

Commit

Permalink
MAGETWO-39604: [GITHUB] Doesn't work sorting in the search list. #1432
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrii Kasian committed Oct 13, 2015
1 parent 9c37e3e commit b1e5ae4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
namespace Magento\Catalog\Block\Product\ProductList;

use Magento\Catalog\Helper\Product\ProductList;
use Magento\Catalog\Model\Product\ProductList\Toolbar as ToolbarModel;

/**
Expand Down Expand Up @@ -63,7 +64,7 @@ class Toolbar extends \Magento\Framework\View\Element\Template
*
* @var string
*/
protected $_direction = \Magento\Catalog\Helper\Product\ProductList::DEFAULT_SORT_DIRECTION;
protected $_direction = ProductList::DEFAULT_SORT_DIRECTION;

/**
* Default View mode
Expand Down Expand Up @@ -102,7 +103,7 @@ class Toolbar extends \Magento\Framework\View\Element\Template
protected $_toolbarModel;

/**
* @var \Magento\Catalog\Helper\Product\ProductList
* @var ProductList
*/
protected $_productListHelper;

Expand All @@ -122,7 +123,7 @@ class Toolbar extends \Magento\Framework\View\Element\Template
* @param \Magento\Catalog\Model\Config $catalogConfig
* @param ToolbarModel $toolbarModel
* @param \Magento\Framework\Url\EncoderInterface $urlEncoder
* @param \Magento\Catalog\Helper\Product\ProductList $productListHelper
* @param ProductList $productListHelper
* @param \Magento\Framework\Data\Helper\PostHelper $postDataHelper
* @param array $data
*/
Expand All @@ -132,7 +133,7 @@ public function __construct(
\Magento\Catalog\Model\Config $catalogConfig,
ToolbarModel $toolbarModel,
\Magento\Framework\Url\EncoderInterface $urlEncoder,
\Magento\Catalog\Helper\Product\ProductList $productListHelper,
ProductList $productListHelper,
\Magento\Framework\Data\Helper\PostHelper $postDataHelper,
array $data = []
) {
Expand Down Expand Up @@ -678,7 +679,7 @@ public function getWidgetOptionsJson(array $customOptions = [])
'order' => ToolbarModel::ORDER_PARAM_NAME,
'limit' => ToolbarModel::LIMIT_PARAM_NAME,
'modeDefault' => $defaultMode,
'directionDefault' => \Magento\Catalog\Helper\Product\ProductList::DEFAULT_SORT_DIRECTION,
'directionDefault' => $this->_direction ?: ProductList::DEFAULT_SORT_DIRECTION,
'orderDefault' => $this->_productListHelper->getDefaultSortField(),
'limitDefault' => $this->_productListHelper->getDefaultLimitPerPageValue($defaultMode),
'url' => $this->getPagerUrl(),
Expand Down

0 comments on commit b1e5ae4

Please sign in to comment.