-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #445 from magento-dragons/092016-pr-2.2
Fixed issues: - MAGETWO-57868: Search fails with an error when used user-defined price attribute as searchable - for mainline - MAGETWO-57924: Unable to add "Customer Group Price" - MAGETWO-55341: Request to ESI doesn't return any data - MAGETWO-57892: L4 Plan fails on mainline branch - MAGETWO-56150: Order comments history shows time of comment twice - MAGETWO-57933: Product quantity is not updated on 'cart/configure' page second time - MAGETWO-53041: 'Yes/No' attribute shown in Advanced Search result even it not used in filtration - MAGETWO-52926: Impossible to find product on Store Front with name like lowerCamelCaseNumber
- Loading branch information
Showing
24 changed files
with
611 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
app/code/Magento/Catalog/view/adminhtml/web/js/form/element/price-input.js
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
app/code/Magento/Catalog/view/adminhtml/web/template/form/element/price-input.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/Decimal.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\CatalogSearch\Model\Search\RequestGenerator; | ||
|
||
|
||
use Magento\Catalog\Model\ResourceModel\Eav\Attribute; | ||
use Magento\Framework\Search\Request\BucketInterface; | ||
use Magento\Framework\Search\Request\FilterInterface; | ||
|
||
class Decimal implements GeneratorInterface | ||
{ | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getFilterData(Attribute $attribute, $filterName) | ||
{ | ||
return [ | ||
'type' => FilterInterface::TYPE_RANGE, | ||
'name' => $filterName, | ||
'field' => $attribute->getAttributeCode(), | ||
'from' => '$' . $attribute->getAttributeCode() . '.from$', | ||
'to' => '$' . $attribute->getAttributeCode() . '.to$', | ||
]; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getAggregationData(Attribute $attribute, $bucketName) | ||
{ | ||
return [ | ||
'type' => BucketInterface::TYPE_DYNAMIC, | ||
'name' => $bucketName, | ||
'field' => $attribute->getAttributeCode(), | ||
'method' => 'manual', | ||
'metric' => [['type' => 'count']], | ||
]; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/General.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\CatalogSearch\Model\Search\RequestGenerator; | ||
|
||
|
||
use Magento\Catalog\Model\ResourceModel\Eav\Attribute; | ||
use Magento\Framework\Search\Request\BucketInterface; | ||
use Magento\Framework\Search\Request\FilterInterface; | ||
|
||
class General implements GeneratorInterface | ||
{ | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getFilterData(Attribute $attribute, $filterName) | ||
{ | ||
return [ | ||
'type' => FilterInterface::TYPE_TERM, | ||
'name' => $filterName, | ||
'field' => $attribute->getAttributeCode(), | ||
'value' => '$' . $attribute->getAttributeCode() . '$', | ||
]; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getAggregationData(Attribute $attribute, $bucketName) | ||
{ | ||
return [ | ||
'type' => BucketInterface::TYPE_TERM, | ||
'name' => $bucketName, | ||
'field' => $attribute->getAttributeCode(), | ||
'metric' => [['type' => 'count']], | ||
]; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/GeneratorInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\CatalogSearch\Model\Search\RequestGenerator; | ||
|
||
|
||
use Magento\Catalog\Model\ResourceModel\Eav\Attribute; | ||
|
||
interface GeneratorInterface | ||
{ | ||
/** | ||
* Get filter data for specific attribute | ||
* @param Attribute $attribute | ||
* @param string $filterName | ||
* @return array | ||
*/ | ||
public function getFilterData(Attribute $attribute, $filterName); | ||
|
||
/** | ||
* Get aggregation data for specific attribute | ||
* @param Attribute $attribute | ||
* @param string $bucketName | ||
* @return array | ||
*/ | ||
public function getAggregationData(Attribute $attribute, $bucketName); | ||
} |
46 changes: 46 additions & 0 deletions
46
app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/GeneratorResolver.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\CatalogSearch\Model\Search\RequestGenerator; | ||
|
||
class GeneratorResolver | ||
{ | ||
/** | ||
* @var GeneratorInterface[] | ||
*/ | ||
private $generators; | ||
|
||
/** | ||
* @var GeneratorInterface | ||
*/ | ||
private $defaultGenerator; | ||
|
||
/** | ||
* @param GeneratorInterface $defaultGenerator | ||
* @param GeneratorInterface[] $generators | ||
*/ | ||
public function __construct(GeneratorInterface $defaultGenerator, array $generators) | ||
{ | ||
$this->defaultGenerator = $defaultGenerator; | ||
$this->generators = $generators; | ||
} | ||
|
||
/** | ||
* @param string $type | ||
* @return GeneratorInterface | ||
* @throws \InvalidArgumentException | ||
*/ | ||
public function getGeneratorForType($type) | ||
{ | ||
$generator = isset($this->generators[$type]) ? $this->generators[$type] : $this->defaultGenerator; | ||
if (!($generator instanceof GeneratorInterface)) { | ||
throw new \InvalidArgumentException( | ||
'Generator must implement ' . GeneratorInterface::class | ||
); | ||
} | ||
return $generator; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.