Skip to content

Commit f780241

Browse files
[EngCom] Public Pull Requests - 2.2-develop
- merged latest code from mainline branch
2 parents d98dfe3 + 5d572a0 commit f780241

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/Configurable.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected function reindex($entityIds = null)
5858
if ($this->hasEntity() || !empty($entityIds)) {
5959
$this->prepareFinalPriceDataForType($entityIds, $this->getTypeId());
6060
$this->_applyCustomOption();
61-
$this->_applyConfigurableOption();
61+
$this->_applyConfigurableOption($entityIds);
6262
$this->_movePriceDataToIndexTable($entityIds);
6363
}
6464
return $this;
@@ -110,10 +110,11 @@ protected function _prepareConfigurableOptionPriceTable()
110110
* Calculate minimal and maximal prices for configurable product options
111111
* and apply it to final price
112112
*
113+
* @param null|int|array $entityIds
113114
* @return \Magento\ConfigurableProduct\Model\ResourceModel\Product\Indexer\Price\Configurable
114115
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
115116
*/
116-
protected function _applyConfigurableOption()
117+
protected function _applyConfigurableOption($entityIds = null)
117118
{
118119
$metadata = $this->getMetadataPool()->getMetadata(ProductInterface::class);
119120
$connection = $this->getConnection();
@@ -133,12 +134,12 @@ protected function _applyConfigurableOption()
133134
['le' => $this->getTable('catalog_product_entity')],
134135
'le.' . $linkField . ' = l.parent_id',
135136
['parent_id' => 'entity_id']
136-
)->join(
137-
['i' => $this->_getDefaultFinalPriceTable()],
138-
'le.entity_id = i.entity_id',
139-
[]
140137
);
141138

139+
if ($entityIds !== null) {
140+
$subSelect->where('le.entity_id IN (?)', $entityIds);
141+
}
142+
142143
$select = $connection->select();
143144
$select
144145
->from(['sub' => new \Zend_Db_Expr('(' . (string)$subSelect . ')')], '')
@@ -178,6 +179,7 @@ protected function _applyConfigurableOption()
178179
' AND i.website_id = io.website_id',
179180
[]
180181
);
182+
// adds price of custom option, that was applied in DefaultPrice::_applyCustomOption
181183
$select->columns(
182184
[
183185
'min_price' => new \Zend_Db_Expr('i.min_price - i.orig_price + io.min_price'),

dev/tests/acceptance/tests/functional.suite.dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ modules:
2525
config:
2626
\Magento\FunctionalTestingFramework\Module\MagentoWebDriver:
2727
url: "%MAGENTO_BASE_URL%"
28-
backend_name: admin
28+
backend_name: "%MAGENTO_BACKEND_NAME%"
2929
browser: 'chrome'
3030
window_size: maximize
3131
username: "%MAGENTO_ADMIN_USERNAME%"

0 commit comments

Comments
 (0)