• 2bearstudio

    (@2bearstudio)


    Wonder if someone could help me with this issue.

    I am doing a custom project. On checkout page, we need to apply a user account balance against cart total. For example:

    Cart total (after tax & everything else) is $100, user has an account balance $50. We need to apply the balance to the cart total. So customer needs to pay $50 only.

    I am trying to use “woocommerce_cart_calculate_fees” hook. However, this hook is applied before tax is calculated. No matter how I change the priority value in the hook, the balance is always applied before tax calculation.

    Any hint? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Thread Starter 2bearstudio

    (@2bearstudio)

    Thank you @riaanknoetze

    I believe I found the solution.

    I now use “woocommerce_calculated_total” directly to update the final cart total. And use “woocommerce_review_order_before_order_total” to display the balance applied to the payment.

    Now, my question becomes, what hook to use to record this to the order (database) and display in order notification email.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘What is the hook for applying a credit / balance to cart total’ is closed to new replies.