-
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-57056: [Backport] [GitHub] Configurable product disabling low…
…est price associated product still shows its price #4419 - for 2.0
- Loading branch information
vnayda
committed
Oct 27, 2016
1 parent
29ac37e
commit 482da28
Showing
24 changed files
with
851 additions
and
121 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
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,25 @@ | ||
<?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 | ||
*/ | ||
interface BaseSelectProcessorInterface | ||
{ | ||
/** | ||
* Product table alias | ||
*/ | ||
const PRODUCT_RELATION_ALIAS = 'link'; | ||
|
||
/** | ||
* @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.