@@ -96,29 +96,85 @@ protected function init() {
9696 return ! empty ( $ this ->data ->get_date_paid () ) ? $ this ->data ->get_date_paid () : null ;
9797 },
9898 'discountTotal ' => function () {
99- return ! empty ( $ this ->data ->get_discount_total () ) ? $ this ->data ->get_discount_total () : 0 ;
100- },
99+ $ price = ! empty ( $ this ->data ->get_discount_total () ) ? $ this ->data ->get_discount_total () : 0 ;
100+ return \wc_graphql_price ( $ price , array ( 'currency ' => $ this ->data ->get_currency () ) );
101+ },
102+ 'discountTotalRaw ' => array (
103+ 'callback ' => function () {
104+ return ! empty ( $ this ->data ->get_discount_total () ) ? $ this ->data ->get_discount_total () : 0 ;
105+ },
106+ 'capability ' => $ this ->post_type_object ->cap ->edit_posts ,
107+ ),
101108 'discountTax ' => function () {
102- return ! empty ( $ this ->data ->get_discount_tax () ) ? $ this ->data ->get_discount_tax () : 0 ;
103- },
109+ $ price = ! empty ( $ this ->data ->get_discount_tax () ) ? $ this ->data ->get_discount_tax () : 0 ;
110+ return \wc_graphql_price ( $ price , array ( 'currency ' => $ this ->data ->get_currency () ) );
111+ },
112+ 'discountTaxRaw ' => array (
113+ 'callback ' => function () {
114+ return ! empty ( $ this ->data ->get_discount_tax () ) ? $ this ->data ->get_discount_tax () : 0 ;
115+ },
116+ 'capability ' => $ this ->post_type_object ->cap ->edit_posts ,
117+ ),
104118 'shippingTotal ' => function () {
105- return ! empty ( $ this ->data ->get_shipping_total () ) ? $ this ->data ->get_shipping_total () : 0 ;
106- },
119+ $ price = ! empty ( $ this ->data ->get_shipping_total () ) ? $ this ->data ->get_shipping_total () : 0 ;
120+ return \wc_graphql_price ( $ price , array ( 'currency ' => $ this ->data ->get_currency () ) );
121+ },
122+ 'shippingTotalRaw ' => array (
123+ 'callback ' => function () {
124+ return ! empty ( $ this ->data ->get_shipping_total () ) ? $ this ->data ->get_shipping_total () : 0 ;
125+ },
126+ 'capability ' => $ this ->post_type_object ->cap ->edit_posts ,
127+ ),
107128 'shippingTax ' => function () {
108- return ! empty ( $ this ->data ->get_shipping_tax () ) ? $ this ->data ->get_shipping_tax () : 0 ;
109- },
129+ $ price = ! empty ( $ this ->data ->get_shipping_tax () ) ? $ this ->data ->get_shipping_tax () : 0 ;
130+ return \wc_graphql_price ( $ price , array ( 'currency ' => $ this ->data ->get_currency () ) );
131+ },
132+ 'shippingTaxRaw ' => array (
133+ 'callback ' => function () {
134+ return ! empty ( $ this ->data ->get_shipping_tax () ) ? $ this ->data ->get_shipping_tax () : 0 ;
135+ },
136+ 'capability ' => $ this ->post_type_object ->cap ->edit_posts ,
137+ ),
110138 'cartTax ' => function () {
111- return ! empty ( $ this ->data ->get_cart_tax () ) ? $ this ->data ->get_cart_tax () : 0 ;
112- },
139+ $ price = ! empty ( $ this ->data ->get_cart_tax () ) ? $ this ->data ->get_cart_tax () : 0 ;
140+ return \wc_graphql_price ( $ price , array ( 'currency ' => $ this ->data ->get_currency () ) );
141+ },
142+ 'cartTaxRaw ' => array (
143+ 'callback ' => function () {
144+ return ! empty ( $ this ->data ->get_cart_tax () ) ? $ this ->data ->get_cart_tax () : 0 ;
145+ },
146+ 'capability ' => $ this ->post_type_object ->cap ->edit_posts ,
147+ ),
113148 'total ' => function () {
114- return ! empty ( $ this ->data ->get_total () ) ? $ this ->data ->get_total () : 0 ;
115- },
149+ $ price = ! empty ( $ this ->data ->get_total () ) ? $ this ->data ->get_total () : 0 ;
150+ return \wc_graphql_price ( $ price , array ( 'currency ' => $ this ->data ->get_currency () ) );
151+ },
152+ 'totalRaw ' => array (
153+ 'callback ' => function () {
154+ return ! empty ( $ this ->data ->get_total () ) ? $ this ->data ->get_total () : 0 ;
155+ },
156+ 'capability ' => $ this ->post_type_object ->cap ->edit_posts ,
157+ ),
116158 'totalTax ' => function () {
117- return ! empty ( $ this ->data ->get_total_tax () ) ? $ this ->data ->get_total_tax () : 0 ;
118- },
159+ $ price = ! empty ( $ this ->data ->get_total_tax () ) ? $ this ->data ->get_total_tax () : 0 ;
160+ return \wc_graphql_price ( $ price , array ( 'currency ' => $ this ->data ->get_currency () ) );
161+ },
162+ 'totalTaxRaw ' => array (
163+ 'callback ' => function () {
164+ return ! empty ( $ this ->data ->get_total_tax () ) ? $ this ->data ->get_total_tax () : 0 ;
165+ },
166+ 'capability ' => $ this ->post_type_object ->cap ->edit_posts ,
167+ ),
119168 'subtotal ' => function () {
120- return ! empty ( $ this ->data ->get_subtotal () ) ? $ this ->data ->get_subtotal () : 0 ;
121- },
169+ $ price = ! empty ( $ this ->data ->get_subtotal () ) ? $ this ->data ->get_subtotal () : null ;
170+ return \wc_graphql_price ( $ price , array ( 'currency ' => $ this ->data ->get_currency () ) );
171+ },
172+ 'subtotalRaw ' => array (
173+ 'callback ' => function () {
174+ return ! empty ( $ this ->data ->get_subtotal () ) ? $ this ->data ->get_subtotal () : 0 ;
175+ },
176+ 'capability ' => $ this ->post_type_object ->cap ->edit_posts ,
177+ ),
122178 'orderNumber ' => function () {
123179 return ! empty ( $ this ->data ->get_order_number () ) ? $ this ->data ->get_order_number () : null ;
124180 },
0 commit comments