Skip to content

Commit 4a31011

Browse files
Updated updateConfigurations.php
For child product - on change of weight, changing product type to simple and making product has weight as 1
1 parent 68c17ec commit 4a31011

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Initialization/Helper/Plugin/UpdateConfigurations.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ protected function getConfigurations()
110110
if (isset($item['qty'])) {
111111
$result[$item['id']]['quantity_and_stock_status']['qty'] = $item['qty'];
112112
}
113+
114+
/* Changing product to simple on weight change*/
115+
if (isset($item['weight']) && $item['weight'] >= 0) {
116+
$result[$item['id']]['type_id'] = \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE;
117+
$result[$item['id']]['product_has_weight'] = \Magento\Catalog\Model\Product\Edit\WeightResolver::HAS_WEIGHT;
118+
}
113119
}
114120
}
115121
}

0 commit comments

Comments
 (0)