[Bug]: Legacy Taxes by Date report fatal error when a partial refund occurs on a date not initialized in $tax_rows
Prerequisites
- I have carried out troubleshooting steps and I believe I have found a bug.
- I have searched for similar bugs in both open and closed issues and cannot find a duplicate.
Describe the bug
The legacy WooCommerce report:
WooCommerce > Reports > Taxes > Taxes by date
can trigger a PHP fatal error when processing a partial refund whose date has not been initialized in $tax_rows.
The error is:
Warning: Undefined array key YYYYMMDD in woocommerce/includes/admin/reports/class-wc-report-taxes-by-date.php
Fatal error: Uncaught Error: Attempt to assign property "tax_amount" on null in class-wc-report-taxes-by-date.php
I narrowed the issue down to a partial refund occurring on a specific day.
The parent order was created and paid on an earlier date, while the partial refund was created on another date. There were no report rows initialized for the refund date.
The issue disappears after defensively initializing $tax_rows[$key] before processing partial refunds.
Expected behavior
The Taxes by date report should include the partial refund on its refund date and render the report normally.
A partial refund should never cause a PHP fatal error, even when there are no order rows for the same date.
Actual behavior
WooCommerce attempts to update:
$tax_rows[ $key ]->tax_amount
when $tax_rows[ $key ] does not exist.
This results in:
Undefined array key YYYYMMDD
followed by:
Attempt to assign property "tax_amount" on null
and the entire Taxes by date report terminates with a critical error.
Steps to reproduce
Enable WooCommerce taxes.
Create and pay an order containing taxable products.
Keep the order in a status included in legacy sales reports, for example Completed or Processing.
On a later date, create a partial refund for that order.
Ensure the refund date is a date for which
$tax_rows_ordersdoes not initialize a report row.Go to: WooCommerce > Reports > Taxes > Taxes by date
Select a date range containing both the original order and the partial refund.
The report can fail with:
Undefined array key YYYYMMDD
Fatal error: Attempt to assign property "tax_amount" on null
WordPress Environment
System Status Report### WordPress Environment ###
WordPress address (URL): [Redacted]
Site address (URL): [Redacted]
WC Version: 11.1.0
Action Scheduler Version: ✔ 4.0.0
Log Directory Writable: ✔
WP Version: 7.1.1
WP Multisite: –
WP Memory Limit: 2 GB
WP Debug Mode: ✔
WP Cron: ✔
WP Environment Type: production
Language: en_US
External object cache: –
### Server Environment ###
Server Info: LiteSpeed
Server Architecture: Linux 5.14.0-687.46.1.el9_8.x86_64 x86_64
PHP Version: 8.3.33
PHP Post Max Size: 1 GB
PHP Time Limit: 360
PHP Max Input Vars: 10000
cURL Version: 8.14.1
OpenSSL/3.5.1
SUHOSIN Installed: –
MySQL Version: 11.8.9-MariaDB-log
Max Upload Size: 1 GB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔
### Database ###
[REDACTED]
### Post Type Counts ###
attachment: 1423
cms_block: 85
custom_css: 1
customize_changeset: 4
e-floating-buttons: 1
elementor_font: 1
elementor_library: 18
mc4wp-form: 1
nav_menu_item: 100
oembed_cache: 5
page: 96
portfolio: 9
post: 6
product: 63
product_variation: 46
revision: 8672
shop_coupon: 11
shop_order: 1094
shop_order_refund: 12
wc_push_token: 1
woodmart_sidebar: 1
woodmart_size_guide: 1
wp_global_styles: 1
wp_navigation: 1
wpcf7_contact_form: 3
wpcode: 3
### Security ###
Secure connection (HTTPS): ✔
Hide errors from visitors: ❌Error messages should not be shown to visitors.
### Active Plugins (37) ###
Advanced Cron Manager: by BracketSpace – 2.7.0
All-in-One WP Migration and Backup: by ServMask – 7.111
Popup Box: by Popup Box Team – 6.4.1
B2B FastOrder POS: by Avisos Digitales – 2.3.3
Contact Form 7: by Rock Lobster Inc. – 6.1.7
Country & Phone Field Contact Form 7: by Narinder Singh Bisht – 2.6.5
Elementor Pro: by Elementor.com – 4.2.2
Elementor: by Elementor.com – 4.1.4
Elfsight Google Maps CC: by Elfsight – 2.4.2
WP All Export - User Export Add-On: by Soflyy – 1.0.2
Gravity Forms: by Gravity Forms – 3.1.1.2
Gravity Forms User Registration Add-On: by Gravity Forms – 5.0
Gravity Forms Webhooks Add-On: by Gravity Forms – 1.3
GTranslate: by Translate AI Multilingual Solutions – 5.0.1
Hostinger Tools: by Hostinger – 3.0.77
WPCode Lite: by WPCode – 2.3.9
Jetpack: by Automattic – 16.2
Live Rates for ShipStation: by IQComputing – 1.2.12
Loco Translate: by Tim Whitlock – 2.8.8
MC4WP: Mailchimp for WordPress: by ibericode – 4.14.1
Kadence Memberships: by Kadence – 4.0.3
Slider Revolution: by ThemePunch – 6.7.32
Royal Elementor Addons: by WP Royal – 1.7.1067
Safe SVG: by 10up – 2.5.0
User Role Editor: by Vladimir Garagulya – 4.66.1
UsersWP: by AyeCode Ltd – 1.2.74
WooCommerce Export Tool: by Avisos Digitales – 1.0.0
WooCommerce Stripe Gateway: by Stripe – 11.0.0
WooCommerce Legacy REST API: by WooCommerce – 1.0.5
WooCommerce PayPal Payments: by PayPal – 4.1.3
PDF Invoices & Packing Slips for WooCommerce: by WP Overnight – 5.16.1
ShipStation for WooCommerce: by WooCommerce – 5.3.6
WooCommerce: by Automattic – 11.1.0
Woodmart Core: by – 1.1.8
WordPress Importer: by wordpressdotorg – 0.9.6
Yoast SEO: by Team Yoast – 28.5
WP All Export Pro: by Soflyy – 1.9.15
### Inactive Plugins (11) ###
All-in-One WP Migration Unlimited Extension: by ServMask – 2.84
Duplicator Pro: by Snap Creek – 4.5.8.3
Hostinger AI: by Hostinger – 3.0.43
Hostinger Easy Onboarding: by Hostinger – 2.1.26
Hostinger Reach: by Hostinger – 1.8.2
LiteSpeed Cache: by LiteSpeed Technologies – 7.9.1
UsersWP - ReCaptcha: by AyeCode Ltd – 1.3.23
WP All Export: by Soflyy – 1.5.0
WP All Export - User Export Add-On Pro: by Soflyy – 1.0.11
WP All Export - WooCommerce Order Export Add-On: by Soflyy – 1.0.5
WP Post Page Clone: by Gaurang Sondagar – 1.3
### Must Use Plugins (3) ###
Elementor Safe Mode: by Elementor.com – 1.0.0
Hostinger Smart Auto Updates: by Hostinger – 1.0.8
Ribeskin - WooCommerce Legacy Tax Report Fix: by Ribeskin – 1.0.0
### Settings ###
Force SSL: –
Currency: USD ($)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)
Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)
Connected to WooCommerce.com: –
Enforce Approved Product Download Directories: ✔
HPOS feature enabled: –
Order datastore: WC_Order_Data_Store_CPT
HPOS data sync enabled: ✔
Enabled Features: analytics
marketplace
order_attribution
site_visibility_badge
remote_logging
email_improvements
blueprint
variation_gallery
point_of_sale
push_notifications
### Logging ###
Enabled: ✔
Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2
Retention period: 30 days
Level threshold: –
Log directory size: 53 MB
### WC Pages ###
Shop base: #10862 - /products-ribeskin/
Cart: #8 - /cart/ - Contains the [woocommerce_cart] shortcode
Checkout: #9 - /checkout/ - Contains the [woocommerce_checkout] shortcode
My account: ❌ Page does not contain the [woocommerce_my_account] shortcode.
Terms and conditions: ❌ Page not set
### Theme ###
Name: Woodmart Child
Version: 1.0.0
Author URL: http://xtemos.com
Child Theme: ✔
Parent Theme Name: Woodmart
Parent Theme Version: 8.5.7 – 8.6.0 is available
Parent Theme Author URL: http://themeforest.net/user/xtemos
Theme type: Classic theme
WooCommerce Support: ✔
### Templates ###
Override: wp-content/themes/woodmart/woocommerce/archive-product.php
Override: wp-content/themes/woodmart/woocommerce/cart/cart-item-data.php
Override: wp-content/plugins/royal-elementor-addons/includes/woocommerce/templates/cart/cart.php ❌ Version 10.1.0 is out of date. The core version is 11.0.0
Override: wp-content/themes/woodmart/woocommerce/cart/cross-sells.php
Override: wp-content/plugins/royal-elementor-addons/includes/woocommerce/templates/cart/mini-cart.php ❌ Version 10.0.0 is out of date. The core version is 11.0.0
Override: wp-content/themes/woodmart/woocommerce/checkout/form-checkout.php
Override: wp-content/themes/woodmart/woocommerce/checkout/thankyou.php
Override: wp-content/themes/woodmart/woocommerce/content-product-cat.php
Override: wp-content/themes/woodmart/woocommerce/content-product.php
Override: wp-content/themes/woodmart/woocommerce/content-single-product.php
Override: wp-content/themes/woodmart/woocommerce/content-widget-product.php
Override: wp-content/themes/woodmart/woocommerce/global/breadcrumb.php
Override: wp-content/themes/woodmart/woocommerce/global/form-login.php
Override: wp-content/themes/woodmart/woocommerce/global/quantity-input.php
Override: wp-content/themes/woodmart/woocommerce/loop/add-to-cart.php
Override: wp-content/themes/woodmart/woocommerce/loop/loop-end.php
Override: wp-content/themes/woodmart/woocommerce/loop/loop-start.php
Override: wp-content/themes/woodmart/woocommerce/loop/no-products-found.php
Override: wp-content/themes/woodmart/woocommerce/loop/orderby.php
Override: wp-content/themes/woodmart/woocommerce/loop/pagination.php
Override: wp-content/themes/woodmart/woocommerce/loop/sale-flash.php
Override: wp-content/themes/woodmart/woocommerce/myaccount/form-login.php
Override: wp-content/themes/woodmart/woocommerce/myaccount/my-account.php
Override: wp-content/plugins/royal-elementor-addons/includes/woocommerce/templates/notices/error.php
Override: wp-content/plugins/royal-elementor-addons/includes/woocommerce/templates/notices/notice.php
Override: wp-content/plugins/royal-elementor-addons/includes/woocommerce/templates/notices/success.php
Override: wp-content/themes/woodmart/woocommerce/product-searchform.php
Override: wp-content/themes/woodmart/woocommerce/single-product/add-to-cart/grouped.php ❌ Version 10.2.0 is out of date. The core version is 11.0.0
Override: wp-content/themes/woodmart/woocommerce/single-product/add-to-cart/variable.php ❌ Version 10.9.0 is out of date. The core version is 11.1.0
Override: wp-content/themes/woodmart/woocommerce/single-product/meta.php
Override: wp-content/themes/woodmart/woocommerce/single-product/product-attributes.php
Override: wp-content/themes/woodmart/woocommerce/single-product/product-image.php ❌ Version 10.5.0 is out of date. The core version is 11.1.0
Override: wp-content/themes/woodmart/woocommerce/single-product/product-thumbnails.php ❌ Version 9.8.0 is out of date. The core version is 11.1.0
Override: wp-content/themes/woodmart/woocommerce/single-product/rating.php
Override: wp-content/themes/woodmart/woocommerce/single-product/related.php
Override: wp-content/themes/woodmart/woocommerce/single-product/sale-flash.php
Override: wp-content/themes/woodmart/woocommerce/single-product/tabs/description.php
Override: wp-content/themes/woodmart/woocommerce/single-product/tabs/tabs.php
Override: wp-content/themes/woodmart/woocommerce/single-product/title.php
Override: wp-content/themes/woodmart/woocommerce/single-product/up-sells.php
Override: wp-content/themes/woodmart/woocommerce/single-product-reviews.php
Override: wp-content/themes/woodmart/woocommerce/single-product.php
Override: wp-content/themes/woodmart/woocommerce/content-product-cat.php
### WooCommerce Stripe Payment Gateway ###
Version: 11.0.0
Account ID: acct_1MftIQFQvA812lIu
Test Mode Enabled: ✔
No
OAuth Connected: No
Sync Enabled: ✔
Yes
Optimized Checkout Enabled: ✔
Yes
Enabled Payment Methods: affirm,afterpay_clearpay,apple_pay,card,google_pay,klarna,link
Express Checkout: ✔
Enabled (product,cart,checkout)
Auth and Capture: ✔
Yes
Logging: No
### WooCommerce PayPal Payments ###
Onboarded: ✔
Branded only: –
Shop country code: US
WooCommerce currency supported: ✔
Advanced Card Processing available in country: ✔
Pay Later messaging available in country: ✔
Webhook status: ✔
Webhook delivery host: ✔
PayPal Vault enabled: ✔
ACDC Vault enabled: ✔
Logging enabled: –
Reference Transactions: ✔
Used PayPal Checkout plugin: –
Subscriptions Mode: Disabled
PayPal Shipping Callback: ✔
Apple Pay: –
Google Pay: –
Fastlane: –
### Admin ###
Enabled Features: store-alerts
Disabled Features: experimental-blocks
minified-js
settings-ui
rest-api-v4
order-detail-redesign
Daily Cron: ✔ Next scheduled: 2026-09-18 18:14:47 -04:00
Options: ✔
Notes: 268
Onboarding: completed
### Action Scheduler ###
Canceled: 6
Oldest: 2026-09-02 21:08:22 -0400
Newest: -0001-11-29 19:03:58 -0456
Complete: 3,102
Oldest: 2026-08-17 03:46:26 -0400
Newest: 2026-09-17 17:10:04 -0400
Failed: 18
Oldest: 2026-06-21 04:03:24 -0400
Newest: 2026-09-17 16:42:12 -0400
Pending: 21
Oldest: 2026-09-17 18:10:04 -0400
Newest: 2026-09-22 21:27:36 -0400
### Status report information ###
Generated at: 2026-09-17 17:12:02 -04:00Isolating the problem
- I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
- This bug happens with a default WordPress theme active, or Storefront.
- I can reproduce this bug consistently using the steps above.
Source: woocommerce/woocommerce