Still looking for solution
More information:
I use a custom payment which I display in an iframe and pass on variables into a form.
I need to pass order total without currency sign after checkout/payment.
I’ve found a way to pass total cart before checkout/payment using
echo WC()->cart->total
On checkout after payment page (thankyou.php) I’ve found
echo $order->get_formatted_order_total();
This will display order total with a currency sign only on the thankyou.php page and will not pass onto any other page no matter what i tried (which isn’t important as I can work with ether thankyou.php page or actual checkout page)
Full code looks like this inside a list
<?php _e( ‘Total:’, ‘woocommerce’ ); ?>
<?php echo $order->get_formatted_order_total(); ?>
I’ve tried testing to see how wordpress stores order total both on thankyou.php page and on a seperate page to see if I can call the order total from the array after checkout/payment but I ether get a value of 0.00 or my page breaks
Code I tried so far:
echo $order->get_order_total();
this breaks the page
echo WC()->$order->get_order_total();
this breaks the page
echo $order->get_total();
this also breaks the page
calling total cart echo WC()->cart->total after checkout/payment will display 0 (which makes sense)