Fatal Error in Dokan Lite get_manage_stock Hook During Checkout
-
I am experiencing a fatal error related to the
get_manage_stock
function within Dokan Lite’s code. This issue occurs during the WooCommerce checkout process and appears to be specific to Dokan’s handling of order items.Error Details: Here’s the error message from my logs:
vbnet
Code kopieren
PHP Fatal error: Uncaught Error: Call to a member function get_manage_stock() on bool in /wp-content/plugins/dokan-lite/includes/Order/Hooks.php on line 542 Stack trace: #0 /wp-includes/class-wp-hook.php(324): WeDevs\Dokan\Order\Hooks->handle_order_notes_for_suborder() #1 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #2 /wp-includes/plugin.php(517): WP_Hook->do_action() #3 /wp-content/plugins/woocommerce/includes/wc-stock-functions.php:170...
Description of the Issue: This error seems to occur when Dokan Lite attempts to retrieve stock information (
get_manage_stock
) on an order item, even if$product
is not valid. In my setup, I have a multisite environment using WooCommerce Global Cart to manage multisite checkout, but the issue is specifically within Dokan Lite’s handling of order stock, as shown in the error trace above.Attempts to Fix: I’ve considered modifying Dokan Lite’s code to add a conditional check around
$product
to ensure it’s a valid object beforeget_manage_stock()
is called. However, I’d prefer to avoid modifying the core plugin code and hope you can advise a way to handle this error more gracefully.Could you please assist in providing a safe, sustainable solution or suggest any hooks or filters that would prevent Dokan from calling
get_manage_stock()
on a non-existent or invalid product object? Your guidance on handling this within Dokan Lite’s structure would be greatly appreciated.Thank you for your help, and please let me know if you need further information to address this issue.
- You must be logged in to reply to this topic.