Closed mmca101 closed 3 months ago
Hey @mmca101 can you double check which version of Woo Subscriptions you have installed. This should have been fixed in v5.8.0 released in December 2023.
I'm going to close this in the mean time given I'm pretty confident the PR (https://github.com/Automattic/woocommerce-subscriptions-core/pull/544) fixed this very issue.
https://github.com/Automattic/woocommerce-subscriptions-core/blob/b49b64021f3417f6d26d6c065330cfcce40aacbc/includes/class-wcs-cart-renewal.php#L418
Im getting a similar error as mentioned in Issue#568 :
PHP Fatal error: Uncaught TypeError: array_sum(): Argument #1 ($array) must be of type array, null given in /wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/class-wcs-cart-renewal.php:449
Adding an extra check in the "get_cart_item_from_session" function (@class-wcs-cart-renewal.php) to see if the line item ID exists in the subscription items array seems to fix this too. Checks added are commented with HOTFIX: