M
M
Mikhail Lebedev2020-07-12 14:48:08
WordPress
Mikhail Lebedev, 2020-07-12 14:48:08

How to display Total Order in any part of the site (woocommerce)?

found the code

<li class="woocommerce-order-overview__total total">
     <?php esc_html_e( 'Total:', 'woocommerce' ); ?>
      <strong><?php echo $order->get_formatted_order_total();  ?></strong>
</li>

but I don’t understand why when you copy-paste it, for example, in the header, it doesn’t show anything except "Total:" ((
how to display the values ​​from this code in any part of the site?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yunus Gaziev, 2020-07-12
@BBoyJuss

Here, most likely, you need the total amount of the basket and not the order, because. Order is an already formed order.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question