• Resolved manujks

    (@manujks)


    Hi
    I need to print order status as well in the pdf invoice. please help me with code to be added in custom template.
    thx in advance

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor kluver

    (@kluver)

    Hi @manujks,

    In a custom template you can use the following code to print the order status:

    <?php echo $this->order->get_status(); ?>

    Thread Starter manujks

    (@manujks)

    Thanks a lot! though i figured this out ( i am very new to this field) thanks to techy like you who are so helpful. I wish to take this opportunity to consult you further. I have inserted the following code in template to print Invoice total in words. (few CSS tweaks also)
    <?php // Get order total
    $order_total = is_callable(array($order, ‘get_total’)) ? $order->get_total() : $order->order_total;
    $currency_symbol = get_woocommerce_currency_symbol( get_woocommerce_currency() );
    echo $currency_symbol . $order_total;?>

    Please tell me is it a way to improve this?
    thx in adv

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! You can greatly simplify this with a function from WooCommerce, wc_price. Try this instead:

    
    <?php echo wc_price( $order->get_total() ); ?>
    

    hope that helps ??

    Happy selling!

    • This reply was modified 6 years, 5 months ago by Ewout. Reason: typo
    Thread Starter manujks

    (@manujks)

    Thanx a lot! I feel like to be your student though at the age of 53.. LOL

    • This reply was modified 6 years, 5 months ago by manujks.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘printing order status in invoices’ is closed to new replies.