Skip to content

Commit c92755e

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

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public function __construct(
4646
*
4747
* @param array $stockData
4848
* @return array
49-
* @throws Exception
5049
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
5150
*/
5251
public function filter(array $stockData)
@@ -65,15 +64,27 @@ public function filter(array $stockData)
6564
if (isset($stockData['min_qty']) && (int)$stockData['min_qty'] < 0) {
6665
$stockData['min_qty'] = 0;
6766
}
67+
$this->allowMultipleBoxesForShippingCheck($stockData);
68+
return $stockData;
69+
}
6870

71+
/**
72+
* Allow Multiple Boxes For Shipping Check
73+
*
74+
* @param array $stockData
75+
* @return array
76+
* @throws Exception
77+
*/
78+
public function allowMultipleBoxesForShippingCheck(array $stockData): array
79+
{
6980
if ((isset($stockData['is_decimal_divided']) && isset($stockData['is_qty_decimal']))
7081
&& $stockData['is_qty_decimal'] == 0 && $stockData['is_decimal_divided'] == 1) {
7182
// phpcs:ignore Magento2.Exceptions.DirectThrow
7283
throw new Exception(__('Please select Advanced Inventory -> Qty Uses Decimals as YES.'));
7384
} else if (!isset($stockData['is_decimal_divided']) || $stockData['is_qty_decimal'] == 0) {
7485
$stockData['is_decimal_divided'] = 0;
7586
}
76-
7787
return $stockData;
7888
}
89+
7990
}

0 commit comments

Comments
 (0)