@@ -177,14 +177,30 @@ protected function mapProductLinkToSelectionModel(
177
177
) {
178
178
$ selectionModel ->setProductId ($ linkedProductId );
179
179
$ selectionModel ->setParentProductId ($ parentProductId );
180
- $ selectionModel ->setSelectionId ($ productLink ->getSelectionId ());
181
- $ selectionModel ->setOptionId ($ productLink ->getOptionId ());
182
- $ selectionModel ->setPosition ($ productLink ->getPosition ());
183
- $ selectionModel ->setSelectionQty ($ productLink ->getQty ());
184
- $ selectionModel ->setSelectionPriceType ($ productLink ->getPriceType ());
185
- $ selectionModel ->setSelectionPriceValue ($ productLink ->getPrice ());
186
- $ selectionModel ->setSelectionCanChangeQty ($ productLink ->getCanChangeQuantity ());
187
- $ selectionModel ->setIsDefault ($ productLink ->getIsDefault ());
180
+ if (($ productLink ->getSelectionId () !== null )) {
181
+ $ selectionModel ->setSelectionId ($ productLink ->getSelectionId ());
182
+ }
183
+ if (($ productLink ->getOptionId () !== null )) {
184
+ $ selectionModel ->setOptionId ($ productLink ->getOptionId ());
185
+ }
186
+ if ($ productLink ->getPosition () !== null ) {
187
+ $ selectionModel ->setPosition ($ productLink ->getPosition ());
188
+ }
189
+ if ($ productLink ->getQty () !== null ) {
190
+ $ selectionModel ->setSelectionQty ($ productLink ->getQty ());
191
+ }
192
+ if ($ productLink ->getPriceType () !== null ) {
193
+ $ selectionModel ->setSelectionPriceType ($ productLink ->getPriceType ());
194
+ }
195
+ if ($ productLink ->getPrice () !== null ) {
196
+ $ selectionModel ->setSelectionPriceValue ($ productLink ->getPrice ());
197
+ }
198
+ if ($ productLink ->getCanChangeQuantity () !== null ) {
199
+ $ selectionModel ->setSelectionCanChangeQty ($ productLink ->getCanChangeQuantity ());
200
+ }
201
+ if ($ productLink ->getIsDefault () !== null ) {
202
+ $ selectionModel ->setIsDefault ($ productLink ->getIsDefault ());
203
+ }
188
204
189
205
return $ selectionModel ;
190
206
}
0 commit comments