Error Cannot access offset of type string on string in new WordPress version
-
I’m experiencing a fatal error with the WooCommerce Abandoned Cart plugin when a product is added to the cart. The error logged is:
PHP Fatal error: Cannot access offset of type string on string in /wp-content/plugins/woocommerce-abandoned-cart/woocommerce-ac.php on line 2191This happens immediately after a product is added to the cart, and it is also preceded by several warnings like:
PHP Warning: Undefined array key “product_id”
PHP Warning: Undefined array key “variation_id”
PHP Warning: Undefined array key “quantity”From what I’ve checked, it seems that the code at that line is trying to access keys such as
['product_id']on a variable that is still a JSON string, and hasn’t been decoded into a PHP array yet. This is what causes the fatal error when treating a string as an array.
Plugin version: 6.4.0
WordPress version: 6.8.1
Elementor version: 3.29.2
The topic ‘Error Cannot access offset of type string on string in new WordPress version’ is closed to new replies.