-
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.
MAGETWO-55838: [Add address] Same address can be added several times at
once Merge branch 'develop' of github.com:magento/magento2ce into MAGETWO-55838
- Loading branch information
Showing
58 changed files
with
1,349 additions
and
1,362 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.