-
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-57055: [Backport] - [GitHub] Configurable product disabling l…
…owest price associated product still shows its price #4419 - for 2.1
- Loading branch information
vnayda
committed
Oct 20, 2016
1 parent
378f711
commit bd01667
Showing
25 changed files
with
781 additions
and
131 deletions.
There are no files selected for viewing
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.