File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed
app/code/Magento/Bundle/Model/ResourceModel
dev/tests/api-functional/testsuite/Magento/Bundle/Api Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -174,8 +174,8 @@ public function saveSelectionPrice($item)
174
174
$ values = [
175
175
'selection_id ' => $ item ->getSelectionId (),
176
176
'website_id ' => $ item ->getWebsiteId (),
177
- 'selection_price_type ' => $ item ->getSelectionPriceType (),
178
- 'selection_price_value ' => $ item ->getSelectionPriceValue (),
177
+ 'selection_price_type ' => $ item ->getSelectionPriceType () ?? 0 ,
178
+ 'selection_price_value ' => $ item ->getSelectionPriceValue () ?? 0 ,
179
179
'parent_product_id ' => $ item ->getParentProductId (),
180
180
];
181
181
$ connection ->insertOnDuplicate (
Original file line number Diff line number Diff line change @@ -87,6 +87,32 @@ public function testAddChild()
87
87
$ this ->assertGreaterThan (0 , $ childId );
88
88
}
89
89
90
+ /**
91
+ * @magentoApiDataFixture Magento/Bundle/_files/product.php
92
+ * @magentoApiDataFixture Magento/Catalog/_files/product_virtual.php
93
+ */
94
+ public function testAddChildWithoutPriceAndPriceType ()
95
+ {
96
+ $ productSku = 'bundle-product ' ;
97
+ $ children = $ this ->getChildren ($ productSku );
98
+
99
+ $ optionId = $ children [0 ]['option_id ' ];
100
+
101
+ $ linkedProduct = [
102
+ 'sku ' => 'virtual-product ' ,
103
+ 'option_id ' => $ optionId ,
104
+ 'position ' => '1 ' ,
105
+ 'is_default ' => 1 ,
106
+ 'priceType ' => null ,
107
+ 'price ' => null ,
108
+ 'qty ' => 8 ,
109
+ 'can_change_quantity ' => 1 ,
110
+ ];
111
+
112
+ $ childId = $ this ->addChild ($ productSku , $ optionId , $ linkedProduct );
113
+ $ this ->assertGreaterThan (0 , $ childId );
114
+ }
115
+
90
116
/**
91
117
* Verify empty out of stock bundle product is in stock after child has been added.
92
118
*
You can’t perform that action at this time.
0 commit comments