Fatal PHP Error in WooCommerce Integration
-
Bug Report: Fatal PHP Error in WooCommerce Integration
Plugin: UTM Event Tracker and Analytics
Affected File:/wp-content/plugins/utm-event-tracker-and-analytics/third-party/woocommerce.php
Line: 497
PHP Version: 8.1.33
WooCommerce Version: 10.0.4Error Details
Uncaught TypeError: Unsupported operand types: string * int in /wp-content/plugins/utm-event-tracker-and-analytics/third-party/woocommerce.php:497Function:
UTM_Event_Tracker\woocommerce_send_view_cart_event('')When This Occurs
- Trigger: Customer views cart page (particularly after adding items or using cart modifications)
- Hook:
template_redirectaction - Result: Fatal error causing “Critical Error” white screen, preventing cart page from loading
Technical Issue
Line 497 in
woocommerce.phpappears to be attempting mathematical multiplication between incompatible data types (string × integer). This is likely happening when the plugin tries to calculate cart values or quantities but receives unexpected data types.Impact
- Cart page completely inaccessible – shows critical error
- Checkout process broken – customers cannot complete purchases
- WooCommerce functionality disrupted – affects core e-commerce operations
- Site appears broken to customers – significant business impact
Steps to Reproduce
- Install plugin on WordPress site with WooCommerce
- Add product to cart
- Navigate to cart page or trigger cart view event
- Fatal error occurs, cart page shows critical error
Expected Behavior
Cart tracking should work without breaking the cart functionality or causing fatal PHP errors.
Workaround
Currently disabling the plugin resolves the issue, but we lose the UTM tracking functionality.
Request
Please review line 497 in the WooCommerce integration file and ensure proper data type handling before mathematical operations. Consider adding type checking or data sanitization to prevent this fatal error.
Environment
- WordPress: 6.8.2
- WooCommerce: 10.0.4
- PHP: 8.1.33
- Server: Apache with standard WordPress hosting
Priority: High – This completely breaks checkout functionality for e-commerce sites.
The topic ‘Fatal PHP Error in WooCommerce Integration’ is closed to new replies.