Skip to content

Commit cf1f778

Browse files
Chhandak.BaruaChhandak.Barua
authored andcommitted
ACP2E-992 Allow Multiple Boxes for Shipping attribute is not saving value - Product Edit
1 parent 0f0e50d commit cf1f778

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/StockDataFilter.php

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
*/
66
namespace Magento\Catalog\Controller\Adminhtml\Product\Initialization;
77

8-
use Exception;
98
use Magento\CatalogInventory\Api\StockConfigurationInterface;
109
use Magento\Framework\App\Config\ScopeConfigInterface;
1110

1211
/**
13-
* Class StockDataFilter to Filter stock data
12+
* Class StockDataFilter
1413
*/
1514
class StockDataFilter
1615
{
1716
/**
1817
* The greatest value which could be stored in CatalogInventory Qty field
1918
*/
20-
public const MAX_QTY_VALUE = 99999999;
19+
const MAX_QTY_VALUE = 99999999;
2120

2221
/**
2322
* @var ScopeConfigInterface
@@ -47,7 +46,6 @@ public function __construct(
4746
* @param array $stockData
4847
* @return array
4948
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
50-
* @throws Exception
5149
*/
5250
public function filter(array $stockData)
5351
{
@@ -65,28 +63,10 @@ public function filter(array $stockData)
6563
if (isset($stockData['min_qty']) && (int)$stockData['min_qty'] < 0) {
6664
$stockData['min_qty'] = 0;
6765
}
68-
$this->allowMultipleBoxesForShippingCheck($stockData);
6966

7067
if (!isset($stockData['is_decimal_divided']) || $stockData['is_qty_decimal'] == 0) {
7168
$stockData['is_decimal_divided'] = 0;
7269
}
7370
return $stockData;
7471
}
75-
76-
/**
77-
* Allow Multiple Boxes For Shipping Check
78-
*
79-
* @param array $stockData
80-
* @return array
81-
* @throws Exception
82-
*/
83-
public function allowMultipleBoxesForShippingCheck(array $stockData): array
84-
{
85-
if ((isset($stockData['is_decimal_divided']) && isset($stockData['is_qty_decimal']))
86-
&& $stockData['is_qty_decimal'] == 0 && $stockData['is_decimal_divided'] == 1) {
87-
// phpcs:ignore Magento2.Exceptions.DirectThrow
88-
throw new Exception(__('Please select Advanced Inventory -> Qty Uses Decimals as YES.'));
89-
}
90-
return $stockData;
91-
}
9272
}

0 commit comments

Comments
 (0)