Skip to content

Commit 6d99569

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

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public function __construct(
4747
* @param array $stockData
4848
* @return array
4949
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
50+
* @throws Exception
5051
*/
5152
public function filter(array $stockData)
5253
{
@@ -65,6 +66,10 @@ public function filter(array $stockData)
6566
$stockData['min_qty'] = 0;
6667
}
6768
$this->allowMultipleBoxesForShippingCheck($stockData);
69+
70+
if (!isset($stockData['is_decimal_divided']) || $stockData['is_qty_decimal'] == 0) {
71+
$stockData['is_decimal_divided'] = 0;
72+
}
6873
return $stockData;
6974
}
7075

@@ -81,8 +86,6 @@ public function allowMultipleBoxesForShippingCheck(array $stockData): array
8186
&& $stockData['is_qty_decimal'] == 0 && $stockData['is_decimal_divided'] == 1) {
8287
// phpcs:ignore Magento2.Exceptions.DirectThrow
8388
throw new Exception(__('Please select Advanced Inventory -> Qty Uses Decimals as YES.'));
84-
} else if (!isset($stockData['is_decimal_divided']) || $stockData['is_qty_decimal'] == 0) {
85-
$stockData['is_decimal_divided'] = 0;
8689
}
8790
return $stockData;
8891
}

0 commit comments

Comments
 (0)