WC()->session->get() errors after 7.8.0 update
-
After upgrading Woocommerce from 7.6.1 to 7.8.0, attempting to use WC()->session->get() to retrieve custom values stored in the Woocommerce session inside a custom theme results in an error:
Uncaught Error: Call to a member function get() on null in /code/web/wp-content/themes/wvecomm/assets/functions/checkout-functions.php:142
I realize this is in a custom theme, not the Woocommerce core, and I was able to solve for this issue myself by making sure to instantiate a specific instance of the Woocommerce session handler prior to retrieving the values stored in the session:
WC()->session = new WC_Session_Handler();
However, I reviewed the entire changelog for all Woocommerce versions between 7.6.1 and 7.8.0, and I do not see ANY changes related to when and where the Woocommerce session handler class is available. I also do not see any changes that suggest a modification in error reporting which might cause this error to surface after the update.
I’ve extensively reviewed the file changes in the PR for the upgrade from 7.6.1->7.8.0 and nothing jumps out as to what caused this. Our site uses the Woocommerce session extensively in a custom way, so Im trying to understand the scope of the change and debug. In desperation I’m posting here, hoping someone can help me understand what changed in this latest patch that would effect the way the session handler works in custom themes.
Thank you very much for your time!
The page I need help with: [log in to see the link]
- The topic ‘WC()->session->get() errors after 7.8.0 update’ is closed to new replies.