Skip to content

Commit

Permalink
[EngCom] Public Pull Requests - 2.2-develop
Browse files Browse the repository at this point in the history
 - merged latest code from mainline branch
  • Loading branch information
magento-engcom-team authored Dec 28, 2017
2 parents 442368a + 5d572a0 commit edbef5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected function reindex($entityIds = null)
if ($this->hasEntity() || !empty($entityIds)) {
$this->prepareFinalPriceDataForType($entityIds, $this->getTypeId());
$this->_applyCustomOption();
$this->_applyConfigurableOption();
$this->_applyConfigurableOption($entityIds);
$this->_movePriceDataToIndexTable($entityIds);
}
return $this;
Expand Down Expand Up @@ -110,10 +110,11 @@ protected function _prepareConfigurableOptionPriceTable()
* Calculate minimal and maximal prices for configurable product options
* and apply it to final price
*
* @param null|int|array $entityIds
* @return \Magento\ConfigurableProduct\Model\ResourceModel\Product\Indexer\Price\Configurable
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
protected function _applyConfigurableOption()
protected function _applyConfigurableOption($entityIds = null)
{
$metadata = $this->getMetadataPool()->getMetadata(ProductInterface::class);
$connection = $this->getConnection();
Expand All @@ -133,12 +134,12 @@ protected function _applyConfigurableOption()
['le' => $this->getTable('catalog_product_entity')],
'le.' . $linkField . ' = l.parent_id',
['parent_id' => 'entity_id']
)->join(
['i' => $this->_getDefaultFinalPriceTable()],
'le.entity_id = i.entity_id',
[]
);

if ($entityIds !== null) {
$subSelect->where('le.entity_id IN (?)', $entityIds);
}

$select = $connection->select();
$select
->from(['sub' => new \Zend_Db_Expr('(' . (string)$subSelect . ')')], '')
Expand Down Expand Up @@ -178,6 +179,7 @@ protected function _applyConfigurableOption()
' AND i.website_id = io.website_id',
[]
);
// adds price of custom option, that was applied in DefaultPrice::_applyCustomOption
$select->columns(
[
'min_price' => new \Zend_Db_Expr('i.min_price - i.orig_price + io.min_price'),
Expand Down
2 changes: 1 addition & 1 deletion dev/tests/acceptance/tests/functional.suite.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ modules:
config:
\Magento\FunctionalTestingFramework\Module\MagentoWebDriver:
url: "%MAGENTO_BASE_URL%"
backend_name: admin
backend_name: "%MAGENTO_BACKEND_NAME%"
browser: 'chrome'
window_size: maximize
username: "%MAGENTO_ADMIN_USERNAME%"
Expand Down

0 comments on commit edbef5d

Please sign in to comment.