Support » Plugin: WooCommerce » Bug: WC 2.3.6 invoice coupon tax display

  • Resolved mensmaximus

    (@mensmaximus)


    Version 2.3.6 announced
    Fix – Saving an order needs to save the discount amount ex. tax like the cart
    Tweak – Show discounts inc. tax when showing order totals inc. tax.

    Issue:
    After the update coupons get applied with the correct amount but show up plus tax on the invoice (thank you page and emails). However the coupons are stored correct in the database and show up with the right amount in the backend order management:

    Order Details:
    [cartdiscount] => 10
    [cartdiscount_tax] => 0.6542

    Order Coupon(Item) Details:
    [discountamount] => 9.3458
    [discountamount_tax] => 0.6542

    Coupon Details:
    [discounttype] => fixedcart
    [coupon_amount] => 10

    If you add the coupon to the cart it shows the amount of -10.00
    On the invoice it shows the amount of -10.65
    The total amount on the invoice is calculated correct (-10.00)
    In wp-admin on the order management it displays -10.00

    The cart contains one product including 7% tax

    The system status does not report any template overrites. In fact this is a vanilla installation of wordpress with woocommerce only for testing.

    This is a serious issue which needs updated templates asap.

    Already posted it on Woothemes Community forum

    https://wordpress.org/plugins/woocommerce/

Viewing 4 replies - 1 through 4 (of 4 total)
  • I just posted a bugreport at https://github.com/woothemes/woocommerce/issues/7728

    For those in need of quick fix just put the following function into your themes functions.php:

    /*
    	Fix discount display in invoices if prices are entered inclusive tax
    	For Woocommerce 2.3.6 only!
    */	
    
    function mmx_display_coupon_incl_tax( $discount, $order ) {
    	if ( get_option( 'woocommerce_prices_include_tax' ) == true ) {
    		$discount = get_post_meta( $order->id, '_cart_discount', true );
    		return wc_price( $discount );
    	}
    	return $discount;
    }
    add_filter( 'woocommerce_order_discount_to_display', 'mmx_display_coupon_incl_tax', 10, 2 );

    Attention:
    – Do not use this code with woocommerce versions any other then 2.3.6
    – Always make a backup before you modify any wordpress file
    – The code has been tested on 9 different installations (WP 4.1.1 and WC 2.3.6) all set to ‘enter prices incl. tax’ and ‘display prices incl. tax’ and worked well. However the code is distributed as is without any warranty

    Thanks, you made my day!!!!!

    For those in need of quick fix just put the following function into your themes functions.php:

    Thank you so much! Works perfectly!

    Plugin Author Claudio Sanches

    (@claudiosanches)

    Fixed in 2.3.7.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Bug: WC 2.3.6 invoice coupon tax display’ is closed to new replies.