Skip to content

Commit 2a62537

Browse files
committed
ACP2E-1388, addressed static
1 parent cc4b8a7 commit 2a62537

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

app/code/Magento/Bundle/Model/Plugin/ProductPriceIndexModifier.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
use Magento\CatalogInventory\Model\Indexer\ProductPriceIndexFilter;
1212
use Magento\Framework\App\ResourceConnection;
1313

14+
/**
15+
* Checks if product is part of dynamic price bundle and skips price reindex
16+
*/
1417
class ProductPriceIndexModifier
1518
{
1619
/**
@@ -23,6 +26,10 @@ class ProductPriceIndexModifier
2326
*/
2427
private ?string $connectionName;
2528

29+
/**
30+
* @param ResourceConnection $resourceConnection
31+
* @param string $connectionName
32+
*/
2633
public function __construct(ResourceConnection $resourceConnection, string $connectionName = 'indexer')
2734
{
2835
$this->resourceConnection = $resourceConnection;
@@ -39,8 +46,12 @@ public function __construct(ResourceConnection $resourceConnection, string $conn
3946
* @param array $entityIds
4047
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4148
*/
42-
public function aroundModifyPrice(ProductPriceIndexFilter $subject, callable $proceed, IndexTableStructure $priceTable, array $entityIds = [])
43-
{
49+
public function aroundModifyPrice(
50+
ProductPriceIndexFilter $subject,
51+
callable $proceed,
52+
IndexTableStructure $priceTable,
53+
array $entityIds = []
54+
) {
4455
if (empty($entityIds)) {
4556
$proceed($priceTable, []);
4657
}
@@ -78,6 +89,6 @@ private function isWithinDynamicPriceBundle(string $priceTableName, int $product
7889
$select->where('entity.type_id = ?', \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE);
7990
$select->where('price.tax_class_id = ?', \Magento\Bundle\Model\Product\Price::PRICE_TYPE_DYNAMIC);
8091

81-
return (int) $connection->fetchOne($select) != 0;
92+
return (int)$connection->fetchOne($select) != 0;
8293
}
8394
}

0 commit comments

Comments
 (0)