Uncaught Error
-
Hi,
We’ve run into what looks like a compatibility issue with your plugin on a WooCommerce site when customers add products to cart via the Store API / Blocks flow.
Error:
Uncaught Error: Call to undefined method Automattic\WooCommerce\StoreApi\SessionHandler::has_session()File:
wp-content/plugins/conditional-extra-fees-for-woocommerce/public/class-apply-payment-processing-fee.phpLine:
28Endpoint being hit:
https://store.com/wp-json/wc/store/v1/cart/add-itemFrom reviewing the stack trace, it appears the plugin is calling WC()->session->has_session() inside Apply_Payment_Processing_Fee->apply_gateway_fee(). That seems to work with the classic WooCommerce session handler, but during Store API cart requests WooCommerce is using Automattic\WooCommerce\StoreApi\SessionHandler, which does not have that method, so it results in a fatal error.
This means the issue is triggered during add-to-cart/cart recalculation on modern WooCommerce flows rather than only during the traditional checkout flow.
Could you please confirm whether the plugin currently supports WooCommerce Store API / Blocks-based cart and checkout requests, and if not, whether you have a patch planned for this?
It looks like the code may need a guard around has_session() or a different approach so it does not assume the session object always exposes the classic session handler methods.
You must be logged in to reply to this topic.