• Resolved lordcase

    (@lordcase)


    On this client site we are using a custom payment gateway plugin, called Simplepay.
    If I switch payment gateways on the cart page (ajax call), the gateway-specific checkout fees are not recalculated and are not reapplied to the total.

    Separately they work fine (when i deactivate all else but the Simplepay gateway) but I need some method to reapply the fees.

    1. which call dos that in your plugin? alg_wc_cf() ?
    2. do you know maybe on which action it should be?
    3. is it supposed to be worling when switching payment methods?

    Thanks,
    Krisz

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter lordcase

    (@lordcase)

    Ok so I solved it. Maybe someone else will find this helpful:

    If you use this plugin together with woocommerce-checkout-page-builder then the following error occurs.
    The page builder’s script (frontend/checkout.js that replaces woocommerce’s checkout.js) is looking for the seleced payment_method in an element with the id #order_review.

    However, Payment Based Gateway Fees does not put the payment methods there, so they are not posted via ajax when the update_checkout is triggered. (They are actually posted but just as part of a post_data array and not as payment_method direct child of $_POST.

    By replacing line 80:
    (return wc_checkout_form.$order_review.find( ‘input[name=”payment_method”]:checked’ ).val();)
    with this:
    return $( ‘.woocommerce-checkout input[name=”payment_method”]:checked’ ).val();
    the issue is solved, payment_method is posted and averyone is happy.

    I’m not sure if this is solvable generally from this plugin, probably not. I’ll send the solution to the authors of checkout-page-builder, maybe they will be willing to fix it.

Viewing 1 replies (of 1 total)
  • The topic ‘How to recalculate fees and reapply them’ is closed to new replies.