File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -106,8 +106,8 @@ protected function _addTax($after = 'discount')
106
106
{
107
107
$ taxTotal = new \Magento \Framework \DataObject (['code ' => 'tax ' , 'block_name ' => $ this ->getNameInLayout ()]);
108
108
$ totals = $ this ->getParentBlock ()->getTotals ();
109
- if ($ totals ['grand_total ' ] ) {
110
- $ this ->getParentBlock ()->addTotalBefore ($ taxTotal , 'grand_total ' );
109
+ if (isset ( $ totals ['grand_total_incl ' ]) ) {
110
+ $ this ->getParentBlock ()->addTotal ($ taxTotal , 'grand_total ' );
111
111
}
112
112
$ this ->getParentBlock ()->addTotal ($ taxTotal , $ after );
113
113
return $ this ;
@@ -322,8 +322,8 @@ protected function _initGrandTotal()
322
322
'label ' => __ ('Grand Total (Incl.Tax) ' ),
323
323
]
324
324
);
325
- $ parent ->addTotal ($ totalExcl , 'grand_total ' );
326
- $ parent ->addTotal ($ totalIncl , 'tax ' );
325
+ $ parent ->addTotal ($ totalIncl , 'grand_total ' );
326
+ $ parent ->addTotal ($ totalExcl , 'tax ' );
327
327
$ this ->_addTax ('grand_total ' );
328
328
}
329
329
return $ this ;
Original file line number Diff line number Diff line change 6
6
namespace Magento \Weee \Block \Sales \Order ;
7
7
8
8
/**
9
+ * Wee tax total column block
10
+ *
9
11
* @api
10
12
* @since 100.0.2
11
13
*/
@@ -54,6 +56,8 @@ public function initTotals()
54
56
$ weeeTotal = $ this ->weeeData ->getTotalAmounts ($ items , $ store );
55
57
$ weeeBaseTotal = $ this ->weeeData ->getBaseTotalAmounts ($ items , $ store );
56
58
if ($ weeeTotal ) {
59
+ $ totals = $ this ->getParentBlock ()->getTotals ();
60
+
57
61
// Add our total information to the set of other totals
58
62
$ total = new \Magento \Framework \DataObject (
59
63
[
@@ -63,10 +67,10 @@ public function initTotals()
63
67
'base_value ' => $ weeeBaseTotal
64
68
]
65
69
);
66
- if ($ this -> getBeforeCondition ( )) {
67
- $ this ->getParentBlock ()->addTotalBefore ($ total , $ this -> getBeforeCondition () );
70
+ if (isset ( $ totals [ ' grand_total_incl ' ] )) {
71
+ $ this ->getParentBlock ()->addTotalBefore ($ total , ' grand_total ' );
68
72
} else {
69
- $ this ->getParentBlock ()->addTotal ($ total , $ this ->getAfterCondition ());
73
+ $ this ->getParentBlock ()->addTotalBefore ($ total , $ this ->getBeforeCondition ());
70
74
}
71
75
}
72
76
return $ this ;
You can’t perform that action at this time.
0 commit comments