Support » Plugin: TaxJar - Sales Tax Automation for WooCommerce » WooCommerce Subscriptions tax total display bug

  • Resolved samrhein


    Hi, I noticed a bug when a WooCommerce Subscriptions product and a regular product are in the cart at the same time. In this scenario, WooCommerce displays two order summary tables, one for the initial purchase, and one for the recurring purchase. The initial order total and the recurring total are being correctly calculated with the correct tax rates, however the initial order table tax line displays the recurring order tax total, which is less than the actual initial order tax total because it’s being calculated from a subset of the initial order.

    I believe this is happening because the recurring order tax calculation causes Taxjar to recalculate the total tax, overwriting the initial order’s total tax. I was able to fix this by editing /includes/class-wc-taxjar-integration.php. At the start of the calculate_totals function I added:

    if (WC_Subscriptions_Cart::get_calculation_type() == 'recurring_total') {

    Not entirely sure why this works or if it will create other issues, so a review from the Taxjar team would be much appreciated! Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor fastdivision


    Hey @samrhein,

    Thanks for reporting this issue and providing some code. We’re also seeing an issue with “sign-up fees” for subscription products not being included in the subtotal correctly. When we attempt to re-instantiate the WC_Cart_Totals class in WooCommerce 3.2, the totals appear incorrect when using WooCommerce Subscriptions. We do this because we’re creating new tax rates in the system after calculating discounts and need to re-calculate the totals again for 3.2. Simply calling that class again without any modifications on our end appears to be causing issues with subscriptions.

    I reached out to Prospress to see if they can provide any additional information. I’m still investigating these subscription-related issues and figuring out what’s going wrong. As soon as I have an update I’ll let you know.

    Thank you!

    Plugin Contributor fastdivision


    @samrhein We’re going to implement this change along with support for WooCommerce Subscription sign-up fees. The pull request is open here which will be released shortly:

    Thank you so much for the help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.