Skip to content
Advertisement

WooCommerce: get and echo “Order Total” on checkout page

I am trying to get the “Order Total” in a function with this code. But not working. The total is not printed at all.

What am I missing here?

JavaScript

Advertisement

Answer

$order_id is not defined, so you cannot access the $order this way either. The $order object is also not yet created against the $cart object.

So you get:

JavaScript

The orders that you can access are orders that have already been created in previous orders

Like:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement