Skip to content

Commit b4b2707

Browse files
Merge branch '2.4-develop' of github.com:magento-gl/magento2ce into ACQE-functional-deployment-version19
2 parents b9f8403 + ba9e7d2 commit b4b2707

File tree

55 files changed

+2035
-1659
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2035
-1659
lines changed

app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml

Lines changed: 0 additions & 133 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
/**
3+
* Copyright 2025 Adobe
4+
* All Rights Reserved.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Bundle\Model\ResourceModel\Indexer;
9+
10+
use Zend_Db_Expr;
11+
12+
class OptionQtyExpressionProvider
13+
{
14+
/**
15+
* Get expression for calculating available quantity for bundle option.
16+
*
17+
* @return Zend_Db_Expr
18+
*/
19+
public function getExpression(): Zend_Db_Expr
20+
{
21+
return new Zend_Db_Expr('i.qty - cisi.min_qty');
22+
}
23+
}

app/code/Magento/Bundle/Model/ResourceModel/Indexer/Stock.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace Magento\Bundle\Model\ResourceModel\Indexer;
99

10+
use Magento\Bundle\Model\Product\Type;
1011
use Magento\Catalog\Model\ResourceModel\Indexer\ActiveTableSwitcher;
1112
use Magento\CatalogInventory\Model\Indexer\Stock\Action\Full;
1213
use Magento\CatalogInventory\Model\ResourceModel\Indexer\Stock\DefaultStock;
@@ -45,6 +46,7 @@ class Stock extends DefaultStock
4546
* @param ActiveTableSwitcher $activeTableSwitcher
4647
* @param StockStatusSelectBuilder $stockStatusSelectBuilder
4748
* @param BundleOptionStockDataSelectBuilder $bundleOptionStockDataSelectBuilder
49+
* @param OptionQtyExpressionProvider $optionQtyExpressionProvider
4850
* @param string $connectionName
4951
*/
5052
public function __construct(
@@ -55,10 +57,14 @@ public function __construct(
5557
ActiveTableSwitcher $activeTableSwitcher,
5658
StockStatusSelectBuilder $stockStatusSelectBuilder,
5759
BundleOptionStockDataSelectBuilder $bundleOptionStockDataSelectBuilder,
60+
private readonly OptionQtyExpressionProvider $optionQtyExpressionProvider,
5861
$connectionName = null
5962
) {
6063
parent::__construct($context, $tableStrategy, $eavConfig, $scopeConfig, $connectionName);
6164

65+
$this->_typeId = Type::TYPE_CODE;
66+
$this->_isComposite = true;
67+
6268
$this->activeTableSwitcher = $activeTableSwitcher;
6369
$this->stockStatusSelectBuilder = $stockStatusSelectBuilder;
6470
$this->bundleOptionStockDataSelectBuilder = $bundleOptionStockDataSelectBuilder;
@@ -198,11 +204,14 @@ protected function _cleanBundleOptionStockData()
198204
private function getOptionsStatusExpression(): \Zend_Db_Expr
199205
{
200206
$connection = $this->getConnection();
207+
208+
$qtyExpr = $this->optionQtyExpressionProvider->getExpression();
201209
$isAvailableExpr = $connection->getCheckSql(
202-
'bs.selection_can_change_qty = 0 AND bs.selection_qty > i.qty',
210+
'bs.selection_can_change_qty = 0 AND bs.selection_qty > ' . $qtyExpr,
203211
'0',
204212
'i.stock_status'
205213
);
214+
206215
if ($this->stockConfiguration->getBackorders()) {
207216
$backordersExpr = $connection->getCheckSql(
208217
'cisi.use_config_backorders = 0 AND cisi.backorders = 0',
@@ -216,6 +225,7 @@ private function getOptionsStatusExpression(): \Zend_Db_Expr
216225
$isAvailableExpr
217226
);
218227
}
228+
219229
if ($this->stockConfiguration->getManageStock()) {
220230
$statusExpr = $connection->getCheckSql(
221231
'cisi.use_config_manage_stock = 0 AND cisi.manage_stock = 0',

app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml

Lines changed: 0 additions & 61 deletions
This file was deleted.

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDisableRememberCategoryPaginationActionGroup.xml

Lines changed: 0 additions & 17 deletions
This file was deleted.

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminEnableRememberCategoryPaginationActionGroup.xml

Lines changed: 0 additions & 17 deletions
This file was deleted.

app/code/Magento/Catalog/Test/Mftf/Data/ConfigData.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,4 @@
4141
<data key="path">catalog/custom_options/use_calendar</data>
4242
<data key="value">0</data>
4343
</entity>
44-
<entity name="EnableRememberCategoryPagination">
45-
<data key="path">catalog/frontend/remember_pagination</data>
46-
<data key="value">1</data>
47-
</entity>
48-
<entity name="DisableRememberCategoryPagination">
49-
<data key="path">catalog/frontend/remember_pagination</data>
50-
<data key="value">0</data>
51-
</entity>
5244
</entities>

0 commit comments

Comments
 (0)