• Resolved deeveedee

    (@deeveedee)


    I just noticed that the extra charge added by woocommerce-extra-charges-option-to-payment-gateways-std plugin is missing from the WooCommerce order details (the order summary displayed after order is submitted). The order total correctly includes the extra charge, but the line item specifying the extra charge is missing. I’m not certain, but I believe that the extra charge was displayed as a separate line item in the order summary up until WooCommerce 2.6.11. Are you aware of any changes in WooCommerce 2.6.12 and later that may have caused the extra charges line item to disappear from the WooCommerce order details? If so, do you know how I can restore the extra charge line item in the order details?

    Thank you for your help and for this plugin.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter deeveedee

    (@deeveedee)

    I was reviewing the post titled “Extra fee not in the pdf invoice” by @troglos and see that this missing line item has probably always been missing. Is the fix for this as simple as replacing the two lines

    
    add_action( 'woocommerce_review_order_before_order_total',  array( $this, 'add_payment_gateway_extra_charges_row'));
    add_action( 'woocommerce_cart_totals_before_order_total',  array( $this, 'add_payment_gateway_extra_charges_row'));
    

    with something like

    
    $woocommerce->cart->add_fee( 'Extra Charges', $this -> current_gateway_extra_charges, true, '' );
    

    I know that it’s not exactly this, since you have two types of extra charges (percentage and flat fee), but is this the right idea?

    If so, when do you think you would have a fix for this?

    Thank you very much for your support.

    Plugin Author hemsingh1

    (@hemsingh1)

    We will look into it and shall post a release with fixes this weekend.

    Plugin Author hemsingh1

    (@hemsingh1)

    Hi,

    I have followed the approach as specified and published it with new updates and it should work as expected. Thanks

    Thread Starter deeveedee

    (@deeveedee)

    @hemsingh1 – Thank you for the update! I have more testing, but so far, it looks like it’s working as it should. I’m not an expert, so forgive some remedial questions to help me learn (if you don’t mind):

    1. Why do you use
      add_action( 'woocommerce_cart_calculate_fees', array( $this, 'calculate_totals' ), 10, 1 );
      instead of
      add_action( 'woocommerce_cart_calculate_fees', 'calculate_totals' , 10, 1 );
    2. What is the purpose of $t3?

    Thank you and thanks again for a great plugin!

    Plugin Author hemsingh1

    (@hemsingh1)

    Hi,

    The reason, I use the action hook in this manner is because the function is declare in a class. Also $t3 is used to for gateway name variable.

    Thanks & Regards,
    hemsingh1

    Thread Starter deeveedee

    (@deeveedee)

    Hi, @hemsingh1. Thank you for taking the time to respond – it helps me to learn. And thanks again for your hard work on this plugin. It is working well for me.

    Thread Starter deeveedee

    (@deeveedee)

    Hi, @hemsingh1. After further testing, your update is working perfectly. Thank you! One of the great things about your plugin is that the extra charge updates automatically/dynamically when selecting different payment methods at checkout. Was there anything special that you needed to do to have the extra charge update automatically (when selecting different payment methods) or did this just happen when you added the action

    
    add_action( 'woocommerce_cart_calculate_fees', array( $this, 'calculate_totals' ), 10, 1 );
    

    I’m learning WordPress and WooCommerce, so your answer would help me to understand, but not urgent. Whenever you have time.

    Thanks again for a great plugin. Nice work.

    • This reply was modified 9 years, 2 months ago by deeveedee.
    Thread Starter deeveedee

    (@deeveedee)

    Hi, @hemsingh1.

    Please disregard my previous question. I figured it out. Thanks again for a great plugin.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Extra charge missing from Order Details’ is closed to new replies.