File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed
app/code/Magento/Sales/Model/Order/Webapi Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Copyright © Magento, Inc. All rights reserved.
4
- * See COPYING.txt for license details .
3
+ * Copyright 2014 Adobe
4
+ * All Rights Reserved .
5
5
*/
6
6
declare (strict_types=1 );
7
7
10
10
use Magento \Sales \Api \Data \OrderItemInterface ;
11
11
use Magento \Sales \Block \Adminhtml \Items \Column \DefaultColumn ;
12
12
use Magento \Sales \Block \Order \Item \Renderer \DefaultRenderer ;
13
+ use Magento \Bundle \Model \Product \Type ;
13
14
14
15
/**
15
16
* Class for changing row total in response.
@@ -62,7 +63,7 @@ public function execute(
62
63
+ $ dataObject ->getBaseWeeeTaxAppliedAmount ()
63
64
- $ dataObject ->getBaseDiscountAmount ());
64
65
65
- return $ result ;
66
+ return $ this -> getBundleProductPrice ( $ result) ;
66
67
}
67
68
68
69
/**
@@ -75,4 +76,24 @@ private function round(float $value): float
75
76
{
76
77
return (float ) max ($ value , 0 );
77
78
}
79
+
80
+ /**
81
+ * Get bundle product price if miss in child item
82
+ *
83
+ * @param array $result
84
+ * @return array
85
+ */
86
+ private function getBundleProductPrice (array $ result ): array
87
+ {
88
+ if (isset ($ result [OrderItemInterface::PRICE ], $ result [OrderItemInterface::PARENT_ITEM ]) &&
89
+ $ result [OrderItemInterface::PRICE ] == 0
90
+ ) {
91
+ if ($ result [OrderItemInterface::PARENT_ITEM ][OrderItemInterface::PRODUCT_TYPE ] == Type::TYPE_CODE ) {
92
+ $ result [OrderItemInterface::PRICE ] =
93
+ $ result [OrderItemInterface::PARENT_ITEM ][OrderItemInterface::PRICE ];
94
+ }
95
+ }
96
+
97
+ return $ result ;
98
+ }
78
99
}
You can’t perform that action at this time.
0 commit comments