Skip to content

Commit

Permalink
Merge pull request #716 from magento-dragons/MAGETWO-43877
Browse files Browse the repository at this point in the history
[DRAGONS][MB] Bugs
  • Loading branch information
Korshenko, Olexii(okorshenko) committed Oct 13, 2015
2 parents 8672b91 + 46a12be commit 6ea96b8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Block/Product/ListProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public function prepareSortableFieldsByCategory($category)
}
$availableOrders = $this->getAvailableOrders();
if (!$this->getSortBy()) {
$categorySortBy = $category->getDefaultSortBy();
$categorySortBy = $this->getDefaultSortBy() ?: $category->getDefaultSortBy();
if ($categorySortBy) {
if (!$availableOrders) {
$availableOrders = $this->_getConfig()->getAttributeUsedForSortByArray();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public function removeOrderFromAvailableOrders($order)
}

/**
* Compare defined order field vith current order field
* Compare defined order field with current order field
*
* @param string $order
* @return bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Magento\Catalog\Model\Config;
use Magento\Catalog\Model\Layer\CollectionFilterInterface;
use Magento\Catalog\Model\Product\Visibility;
use Magento\Framework\DB\Select;
use Magento\Store\Model\StoreManagerInterface;

class CollectionFilter implements CollectionFilterInterface
Expand Down Expand Up @@ -63,7 +62,6 @@ public function filter(
->addTaxPercents()
->addStoreFilter()
->addUrlRewrite()
->setVisibility($this->productVisibility->getVisibleInSearchIds())
->setOrder('relevance', Select::SQL_DESC);
->setVisibility($this->productVisibility->getVisibleInSearchIds());
}
}
10 changes: 4 additions & 6 deletions app/code/Magento/CatalogImportExport/Model/Export/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -874,13 +874,11 @@ protected function collectRawData()
}

if ($this->_attributeTypes[$code] !== 'multiselect') {
if (is_scalar($attrValue)) {
if (!in_array($fieldName, $this->_getExportMainAttrCodes())) {
$additionalAttributes[$fieldName] = $fieldName .
ImportProduct::PAIR_NAME_VALUE_SEPARATOR . $attrValue;
}
$data[$itemId][$storeId][$fieldName] = $attrValue;
if (!in_array($fieldName, $this->_getExportMainAttrCodes())) {
$additionalAttributes[$fieldName] = $fieldName .
ImportProduct::PAIR_NAME_VALUE_SEPARATOR . $attrValue;
}
$data[$itemId][$storeId][$fieldName] = $attrValue;
} else {
$this->collectMultiselectValues($item, $code, $storeId);
if (!empty($this->collectedMultiselectsData[$storeId][$itemId][$code])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public function __construct(ObjectManagerInterface $objectManager, $customizers
public function prepareData($collection, $productIds)
{
foreach ($this->customizers as $className) {
$this->objectManager->get($className)->prepareData($collection, $productIds);
$customCollection = clone $collection;
$this->objectManager->get($className)->prepareData($customCollection, $productIds);
}
}

Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/CatalogSearch/Block/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,13 @@ public function setListOrders()
/* @var $category \Magento\Catalog\Model\Category */
$availableOrders = $category->getAvailableSortByOptions();
unset($availableOrders['position']);
$availableOrders['relevance'] = __('Relevance');

$this->getListBlock()->setAvailableOrders(
$availableOrders
)->setDefaultDirection(
'desc'
)->setSortBy(
)->setDefaultSortBy(
'relevance'
);

Expand Down

0 comments on commit 6ea96b8

Please sign in to comment.