-
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 #536 from magento-dragons/MAGETWO-59879
[Dragons] Bugfixing 2.1 - MAGETWO-57055 [Backport] - [GitHub] Configurable product disabling lowest price associated product still shows its price #4419 - for 2.1 - MAGETWO-59879 [Backport] - "As low as" is displayed for configurable product on Category page if min price configuration isn't available - for 2.1.3 - MAGETWO-59874 [Backport] - Non consistent save Product Stock Item via Web API and repository directly - for 2.1
- Loading branch information
Showing
30 changed files
with
931 additions
and
141 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
26 changes: 26 additions & 0 deletions
26
app/code/Magento/Catalog/Model/ResourceModel/Product/BaseSelectProcessorInterface.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,26 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Catalog\Model\ResourceModel\Product; | ||
|
||
use Magento\Framework\DB\Select; | ||
|
||
/** | ||
* Interface BaseSelectProcessorInterface | ||
* @api | ||
*/ | ||
interface BaseSelectProcessorInterface | ||
{ | ||
/** | ||
* Product table alias | ||
*/ | ||
const PRODUCT_TABLE_ALIAS = 'child'; | ||
|
||
/** | ||
* @param Select $select | ||
* @return Select | ||
*/ | ||
public function process(Select $select); | ||
} |
49 changes: 49 additions & 0 deletions
49
app/code/Magento/Catalog/Model/ResourceModel/Product/CompositeBaseSelectProcessor.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,49 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Catalog\Model\ResourceModel\Product; | ||
|
||
use Magento\Framework\DB\Select; | ||
use Magento\Framework\Exception\InputException; | ||
|
||
/** | ||
* Class CompositeBaseSelectProcessor | ||
*/ | ||
class CompositeBaseSelectProcessor implements BaseSelectProcessorInterface | ||
{ | ||
/** | ||
* @var BaseSelectProcessorInterface[] | ||
*/ | ||
private $baseSelectProcessors; | ||
|
||
/** | ||
* @param BaseSelectProcessorInterface[] $baseSelectProcessors | ||
* @throws InputException | ||
*/ | ||
public function __construct( | ||
array $baseSelectProcessors | ||
) { | ||
foreach ($baseSelectProcessors as $baseSelectProcessor) { | ||
if (!$baseSelectProcessor instanceof BaseSelectProcessorInterface) { | ||
throw new InputException( | ||
__('Processor %1 doesn\'t implement BaseSelectProcessorInterface', get_class($baseSelectProcessor)) | ||
); | ||
} | ||
} | ||
$this->baseSelectProcessors = $baseSelectProcessors; | ||
} | ||
|
||
/** | ||
* @param Select $select | ||
* @return Select | ||
*/ | ||
public function process(Select $select) | ||
{ | ||
foreach ($this->baseSelectProcessors as $baseSelectProcessor) { | ||
$select = $baseSelectProcessor->process($select); | ||
} | ||
return $select; | ||
} | ||
} |
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
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.