Skip to content

Commit 6ea96b8

Browse files
author
Korshenko, Olexii(okorshenko)
committed
Merge pull request #716 from magento-dragons/MAGETWO-43877
[DRAGONS][MB] Bugs
2 parents 8672b91 + 46a12be commit 6ea96b8

File tree

6 files changed

+11
-13
lines changed

6 files changed

+11
-13
lines changed

app/code/Magento/Catalog/Block/Product/ListProduct.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public function prepareSortableFieldsByCategory($category)
296296
}
297297
$availableOrders = $this->getAvailableOrders();
298298
if (!$this->getSortBy()) {
299-
$categorySortBy = $category->getDefaultSortBy();
299+
$categorySortBy = $this->getDefaultSortBy() ?: $category->getDefaultSortBy();
300300
if ($categorySortBy) {
301301
if (!$availableOrders) {
302302
$availableOrders = $this->_getConfig()->getAttributeUsedForSortByArray();

app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ public function removeOrderFromAvailableOrders($order)
356356
}
357357

358358
/**
359-
* Compare defined order field vith current order field
359+
* Compare defined order field with current order field
360360
*
361361
* @param string $order
362362
* @return bool

app/code/Magento/Catalog/Model/Layer/Search/CollectionFilter.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Magento\Catalog\Model\Config;
99
use Magento\Catalog\Model\Layer\CollectionFilterInterface;
1010
use Magento\Catalog\Model\Product\Visibility;
11-
use Magento\Framework\DB\Select;
1211
use Magento\Store\Model\StoreManagerInterface;
1312

1413
class CollectionFilter implements CollectionFilterInterface
@@ -63,7 +62,6 @@ public function filter(
6362
->addTaxPercents()
6463
->addStoreFilter()
6564
->addUrlRewrite()
66-
->setVisibility($this->productVisibility->getVisibleInSearchIds())
67-
->setOrder('relevance', Select::SQL_DESC);
65+
->setVisibility($this->productVisibility->getVisibleInSearchIds());
6866
}
6967
}

app/code/Magento/CatalogImportExport/Model/Export/Product.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -874,13 +874,11 @@ protected function collectRawData()
874874
}
875875

876876
if ($this->_attributeTypes[$code] !== 'multiselect') {
877-
if (is_scalar($attrValue)) {
878-
if (!in_array($fieldName, $this->_getExportMainAttrCodes())) {
879-
$additionalAttributes[$fieldName] = $fieldName .
880-
ImportProduct::PAIR_NAME_VALUE_SEPARATOR . $attrValue;
881-
}
882-
$data[$itemId][$storeId][$fieldName] = $attrValue;
877+
if (!in_array($fieldName, $this->_getExportMainAttrCodes())) {
878+
$additionalAttributes[$fieldName] = $fieldName .
879+
ImportProduct::PAIR_NAME_VALUE_SEPARATOR . $attrValue;
883880
}
881+
$data[$itemId][$storeId][$fieldName] = $attrValue;
884882
} else {
885883
$this->collectMultiselectValues($item, $code, $storeId);
886884
if (!empty($this->collectedMultiselectsData[$storeId][$itemId][$code])) {

app/code/Magento/CatalogImportExport/Model/Export/RowCustomizer/Composite.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public function __construct(ObjectManagerInterface $objectManager, $customizers
4040
public function prepareData($collection, $productIds)
4141
{
4242
foreach ($this->customizers as $className) {
43-
$this->objectManager->get($className)->prepareData($collection, $productIds);
43+
$customCollection = clone $collection;
44+
$this->objectManager->get($className)->prepareData($customCollection, $productIds);
4445
}
4546
}
4647

app/code/Magento/CatalogSearch/Block/Result.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,13 @@ public function setListOrders()
133133
/* @var $category \Magento\Catalog\Model\Category */
134134
$availableOrders = $category->getAvailableSortByOptions();
135135
unset($availableOrders['position']);
136+
$availableOrders['relevance'] = __('Relevance');
136137

137138
$this->getListBlock()->setAvailableOrders(
138139
$availableOrders
139140
)->setDefaultDirection(
140141
'desc'
141-
)->setSortBy(
142+
)->setDefaultSortBy(
142143
'relevance'
143144
);
144145

0 commit comments

Comments
 (0)