Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter makarowich

    (@makarowich)

    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)

    Thread Starter makarowich

    (@makarowich)

    Not solution but a workaround.
    I managed to find how to edit the actual checkout page which is called
    form-checkout.php

    I inserted the iframe with custom text in there and used

    echo WC()->cart->total

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to call total order after payment?’ is closed to new replies.