Non-taxable shipping method issue
-
Hi team,
I found what looks like a bug in
stripe-tax-for-woocommerceaffecting checkout totals when the selected shipping method is non-taxable.Observed behavior:
- WooCommerce checkout shows the shipping line correctly, for example:
- Product:
$50.00 - Shipping:
$10.00
- Product:
- But the returned order-review total is still
$50.00instead of$60.00 - Stripe payment initialization also reflects the wrong amount
- This only happens for a shipping rate set as non-taxable
The source of the problem seems to be in
Stripe/Tax_Calculation/class-cart-input.php, whereCart_Input::get_taxable_shipping_cost_amount()only includes shipping cost when the chosen shipping method hastax_status = taxable.The current logic:
- selected rate is loaded from
chosen_shipping_methods - plugin loads
woocommerce_<method>_<instance>_settings - if
tax_status !== taxable, it skips that shipping amount entirely
That means non-taxable shipping is being excluded from the Stripe Tax cart input, so later in
class-cart-controller.php, theset_total( $tax_calculation_result->amount_total )method is called with a total that excludes shipping entirely, instead of including shipping as non-taxed.There appears to be a matching pattern in
Stripe/Tax_Calculation/class-order-input.phpas well.Expected behavior:
- Non-taxable shipping should still be included in the cart/order total
- It should simply not receive shipping tax
Suggested fix direction:
- Include chosen shipping cost in the Stripe Tax input regardless of whether the shipping method is taxable
- Only mark shipping as taxable / assign a shipping tax code when the method is actually taxable
- For non-taxable shipping, pass the amount through but omit taxability so tax remains zero
Hope this helps get a quick fix since we’re having issues where our orders are coming in with $0 as the shipping cost and we’re having to assume those costs.
- WooCommerce checkout shows the shipping line correctly, for example:
You must be logged in to reply to this topic.