WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce Print Invoice & Delivery Note
order totals order (3 posts)

  1. tomboersma
    Member
    Posted 1 year ago #

    Ok, this is a somewhat confusing post title...

    The case is that in Norway it's usual to present order totals as follow:

    order subtotal (inc VAT) 100kr
    shipping (inc VAT) 40kr
    order total (inc VAT) 140kr

    of which VAT 28kr

    By default it is shown like this

    order subtotal (inc VAT) 100kr
    shipping (inc VAT) 40kr
    of which VAT 28kr
    order total (inc VAT) 140kr

    Would it be possible to move the "of which VAT" under the order total by somehow changing the wcdn_get_order_totals?

    Thanks!

    http://wordpress.org/extend/plugins/woocommerce-delivery-notes/

  2. piffpaffpuff
    Member
    Plugin Author

    Posted 1 year ago #

    the plugin uses the same order totals output as woocommerce. so you rather need to change the order in woocommerce first via a filter hook. and also set the vat settings in woocommerce correctly. here some code to give you an idea:

    function change_order_items_order($total_rows, $order) {
        // now reorder the $total_rows to the way you like it
        return $total_rows;
    }
    add_filter( 'woocommerce_get_order_item_totals', 'woocommerce_get_order_item_totals', 10, 2);
  3. tomboersma
    Member
    Posted 1 year ago #

    Thanks so far!

    My php knowledge is unfortunately not good enough to finish this snippet but I'll post my question at Woocommerce, where it belongs...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic