@@ -181,22 +181,26 @@ protected function parseSelections($rowData, $entityId)
181
181
return [];
182
182
}
183
183
184
- $ rowData ['bundle_values ' ] = str_replace (
185
- self ::BEFORE_OPTION_VALUE_DELIMITER ,
186
- $ this ->_entityModel ->getMultipleValueSeparator (),
187
- $ rowData ['bundle_values ' ]
188
- );
189
- $ selections = explode (
190
- Product::PSEUDO_MULTI_LINE_SEPARATOR ,
191
- $ rowData ['bundle_values ' ]
192
- );
184
+ if (is_string ($ rowData ['bundle_values ' ])) {
185
+ $ rowData ['bundle_values ' ] = str_replace (
186
+ self ::BEFORE_OPTION_VALUE_DELIMITER ,
187
+ $ this ->_entityModel ->getMultipleValueSeparator (),
188
+ $ rowData ['bundle_values ' ]
189
+ );
190
+ $ selections = explode (
191
+ Product::PSEUDO_MULTI_LINE_SEPARATOR ,
192
+ $ rowData ['bundle_values ' ]
193
+ );
194
+ } else {
195
+ $ selections = $ rowData ['bundle_values ' ];
196
+ }
197
+
193
198
foreach ($ selections as $ selection ) {
194
- $ values = explode ($ this ->_entityModel ->getMultipleValueSeparator (), $ selection );
195
- $ option = $ this ->parseOption ($ values );
196
- if (isset ($ option ['sku ' ]) && isset ($ option ['name ' ])) {
197
- if (!isset ($ this ->_cachedOptions [$ entityId ])) {
198
- $ this ->_cachedOptions [$ entityId ] = [];
199
- }
199
+ $ option = is_string ($ selection )
200
+ ? $ this ->parseOption (explode ($ this ->_entityModel ->getMultipleValueSeparator (), $ selection ))
201
+ : $ selection ;
202
+
203
+ if (isset ($ option ['sku ' ], $ option ['name ' ])) {
200
204
$ this ->_cachedSkus [] = $ option ['sku ' ];
201
205
if (!isset ($ this ->_cachedOptions [$ entityId ][$ option ['name ' ]])) {
202
206
$ this ->_cachedOptions [$ entityId ][$ option ['name ' ]] = [];
0 commit comments