File tree Expand file tree Collapse file tree 2 files changed +14
-28
lines changed Expand file tree Collapse file tree 2 files changed +14
-28
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,23 @@ protected function _initTotals()
42
42
'area ' => 'footer ' ,
43
43
]
44
44
);
45
- $ this ->_totals ['due ' ] = new \Magento \Framework \DataObject (
45
+ $ code = 'due ' ;
46
+ $ label = 'Total Due ' ;
47
+ $ value = $ this ->getSource ()->getTotalDue ();
48
+ $ baseValue = $ this ->getSource ()->getBaseTotalDue ();
49
+ if ($ this ->getSource ()->getTotalCanceled () > 0 && $ this ->getSource ()->getBaseTotalCanceled () > 0 ) {
50
+ $ code = 'canceled ' ;
51
+ $ label = 'Total Canceled ' ;
52
+ $ value = $ this ->getSource ()->getTotalCanceled ();
53
+ $ baseValue = $ this ->getSource ()->getBaseTotalCanceled ();
54
+ }
55
+ $ this ->_totals [$ code ] = new \Magento \Framework \DataObject (
46
56
[
47
57
'code ' => 'due ' ,
48
58
'strong ' => true ,
49
- 'value ' => $ this -> getSource ()-> getTotalDue () ,
50
- 'base_value ' => $ this -> getSource ()-> getBaseTotalDue () ,
51
- 'label ' => $ this -> getSource ()-> getTotalDueCancelLabel ( ),
59
+ 'value ' => $ value ,
60
+ 'base_value ' => $ baseValue ,
61
+ 'label ' => __ ( $ label ),
52
62
'area ' => 'footer ' ,
53
63
]
54
64
);
Original file line number Diff line number Diff line change @@ -1817,30 +1817,6 @@ public function getTotalDue()
1817
1817
return max ($ total , 0 );
1818
1818
}
1819
1819
1820
- /**
1821
- * Retrieve order total due or cancel label
1822
- *
1823
- * @return float|null
1824
- */
1825
- public function getTotalDueCancelLabel ()
1826
- {
1827
- $ itemCancel = true ;
1828
- foreach ($ this ->getAllItems () as $ item ) {
1829
- if ($ item ->getQtyCanceled () > 0 ) {
1830
- $ itemCancel = false ;
1831
- break ;
1832
- }
1833
- }
1834
- if ($ this ->isCanceled () || $ itemCancel == false ) {
1835
-
1836
- $ label = __ ('Total Canceled ' );
1837
- } else {
1838
-
1839
- $ label = __ ('Total Due ' );
1840
- }
1841
- return $ label ;
1842
- }
1843
-
1844
1820
/**
1845
1821
* Retrieve order total due value
1846
1822
*
You can’t perform that action at this time.
0 commit comments