Fatal Error When Cancelling Orders
-
Dear WT Smart Coupons Support Team,
I’m experiencing a fatal error when trying to cancel WooCommerce orders that have 100% discount coupons applied. Here are the specific details:Problem Description
When I try to cancel an order from the individual order edit page, I get a fatal error. However, the cancellation works perfectly when using bulk operations on the orders overview page.
Error Message:
PHP Fatal error: Uncaught Error: Call to a member function get_cart() on null in /wp-content/plugins/wt-smart-coupons-for-woocommerce/public/modules/exclude-product/exclude-product.php:161Key Observations
- The error only occurs on the order edit page, not during bulk operations
- The issue specifically involves orders with 0 totals.
- The plugin tries to access
WC()->cart->get_cart()during validation, butWC()->cartis null in admin context
I look forward to your response and any guidance you can provide.
The topic ‘Fatal Error When Cancelling Orders’ is closed to new replies.