Skip to content

Commit 2d3a876

Browse files
committed
Merge remote-tracking branch 'mainline/2.2-develop' into 2.2-develop-PR-port-21079
2 parents 905085d + 945fa8e commit 2d3a876

File tree

3 files changed

+35
-7
lines changed

3 files changed

+35
-7
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/CustomOptionPriceModifier.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds =
127127
}
128128

129129
/**
130+
* Check if custom options exist.
131+
*
130132
* @param IndexTableStructure $priceTable
131133
* @return bool
132134
* @throws \Exception
@@ -154,6 +156,8 @@ private function checkIfCustomOptionsExist(IndexTableStructure $priceTable): boo
154156
}
155157

156158
/**
159+
* Get connection.
160+
*
157161
* @return \Magento\Framework\DB\Adapter\AdapterInterface
158162
*/
159163
private function getConnection()
@@ -211,7 +215,7 @@ private function getSelectForOptionsWithMultipleValues(string $sourceTable): Sel
211215
} else {
212216
$select->joinLeft(
213217
['otps' => $this->getTable('catalog_product_option_type_price')],
214-
'otps.option_type_id = otpd.option_type_id AND otpd.store_id = cwd.default_store_id',
218+
'otps.option_type_id = otpd.option_type_id AND otps.store_id = cwd.default_store_id',
215219
[]
216220
);
217221

@@ -373,6 +377,8 @@ private function getSelectAggregated(string $sourceTable): Select
373377
}
374378

375379
/**
380+
* Get select for update.
381+
*
376382
* @param string $sourceTable
377383
* @return \Magento\Framework\DB\Select
378384
*/
@@ -402,6 +408,8 @@ private function getSelectForUpdate(string $sourceTable): Select
402408
}
403409

404410
/**
411+
* Get table name.
412+
*
405413
* @param string $tableName
406414
* @return string
407415
*/
@@ -411,6 +419,8 @@ private function getTable(string $tableName): string
411419
}
412420

413421
/**
422+
* Is price scope global.
423+
*
414424
* @return bool
415425
*/
416426
private function isPriceGlobal(): bool

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
/**
1212
* Default Product Type Price Indexer Resource model
13+
*
1314
* For correctly work need define product type id
1415
*
1516
* @api
@@ -208,6 +209,8 @@ public function reindexEntity($entityIds)
208209
}
209210

210211
/**
212+
* Reindex prices.
213+
*
211214
* @param null|int|array $entityIds
212215
* @return \Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice
213216
*/
@@ -604,7 +607,7 @@ protected function _applyCustomOption()
604607
[]
605608
)->joinLeft(
606609
['otps' => $this->getTable('catalog_product_option_type_price')],
607-
'otps.option_type_id = otpd.option_type_id AND otpd.store_id = cs.store_id',
610+
'otps.option_type_id = otpd.option_type_id AND otps.store_id = cs.store_id',
608611
[]
609612
)->group(
610613
['i.entity_id', 'i.customer_group_id', 'i.website_id', 'o.option_id']
@@ -802,6 +805,8 @@ public function getIdxTable($table = null)
802805
}
803806

804807
/**
808+
* Check if product exists.
809+
*
805810
* @return bool
806811
*/
807812
protected function hasEntity()
@@ -823,6 +828,8 @@ protected function hasEntity()
823828
}
824829

825830
/**
831+
* Get total tier price expression.
832+
*
826833
* @param \Zend_Db_Expr $priceExpression
827834
* @return \Zend_Db_Expr
828835
*/
@@ -862,6 +869,13 @@ private function getTotalTierPriceExpression(\Zend_Db_Expr $priceExpression)
862869
);
863870
}
864871

872+
/**
873+
* Get tier price expression for table.
874+
*
875+
* @param string $tableAlias
876+
* @param \Zend_Db_Expr $priceExpression
877+
* @return \Zend_Db_Expr
878+
*/
865879
private function getTierPriceExpressionForTable($tableAlias, \Zend_Db_Expr $priceExpression)
866880
{
867881
return $this->getConnection()->getCheckSql(

app/code/Magento/Catalog/Pricing/Price/MinimalTierPriceCalculator.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ public function __construct(CalculatorInterface $calculator)
2929
}
3030

3131
/**
32-
* Get raw value of "as low as" as a minimal among tier prices
33-
* {@inheritdoc}
32+
* Get raw value of "as low as" as a minimal among tier prices{@inheritdoc}
33+
*
34+
* @param SaleableInterface $saleableItem
35+
* @return float|null
3436
*/
3537
public function getValue(SaleableInterface $saleableItem)
3638
{
@@ -49,15 +51,17 @@ public function getValue(SaleableInterface $saleableItem)
4951
}
5052

5153
/**
52-
* Return calculated amount object that keeps "as low as" value
53-
* {@inheritdoc}
54+
* Return calculated amount object that keeps "as low as" value{@inheritdoc}
55+
*
56+
* @param SaleableInterface $saleableItem
57+
* @return AmountInterface|null
5458
*/
5559
public function getAmount(SaleableInterface $saleableItem)
5660
{
5761
$value = $this->getValue($saleableItem);
5862

5963
return $value === null
6064
? null
61-
: $this->calculator->getAmount($value, $saleableItem);
65+
: $this->calculator->getAmount($value, $saleableItem, 'tax');
6266
}
6367
}

0 commit comments

Comments
 (0)