File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed
app/code/Magento/Sales/Model/Order Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ class CreditmemoFactory
22
22
*/
23
23
protected $ taxConfig ;
24
24
25
+ /**
26
+ * @var \Magento\Framework\Unserialize\Unserialize
27
+ */
28
+ protected $ unserialize ;
29
+
25
30
/**
26
31
* Factory constructor
27
32
*
@@ -261,13 +266,27 @@ private function calculateProductOptions(\Magento\Sales\Api\Data\OrderItemInterf
261
266
$ qty = 1 ;
262
267
$ productOptions = $ orderItem ->getProductOptions ();
263
268
if (isset ($ productOptions ['bundle_selection_attributes ' ])) {
264
- $ bundleSelectionAttributes = unserialize (
265
- $ productOptions ['bundle_selection_attributes ' ]
266
- );
269
+ $ bundleSelectionAttributes = $ this ->getUnserialize ()
270
+ ->unserialize ($ productOptions ['bundle_selection_attributes ' ]);
267
271
if ($ bundleSelectionAttributes ) {
268
272
$ qty = $ bundleSelectionAttributes ['qty ' ] * $ qtys [$ orderItem ->getParentItemId ()];
269
273
}
270
274
}
271
275
return $ qty ;
272
276
}
277
+
278
+ /**
279
+ * Get Unserialize
280
+ *
281
+ * @return \Magento\Framework\Unserialize\Unserialize
282
+ * @deprecated
283
+ */
284
+ private function getUnserialize ()
285
+ {
286
+ if (!$ this ->unserialize ) {
287
+ $ this ->unserialize = \Magento \Framework \App \ObjectManager::getInstance ()
288
+ ->get (\Magento \Framework \Unserialize \Unserialize::class);
289
+ }
290
+ return $ this ->unserialize ;
291
+ }
273
292
}
You can’t perform that action at this time.
0 commit comments