I tried this in misc
add_filter( 'woe_order_export_started', function ( $order_id ) {
$order = new WC_Order($order_id);
return ($order->get_comments()) ? $order_id: false;
});
I get this error
Fatal error: Uncaught Error: Call to undefined method WC_Order::get_comments() in C:\xampp\htdocs\wp1\wp-content\plugins\woo-order-export-lite\classes\core\class-wc-order-export-engine.php(345) : eval()'d code:4 Stack trace: #0 C:\xampp\htdocs\wp1\wp-includes\class-wp-hook.php(292): WC_Order_Export_Engine::{closure}('233426') #1 C:\xampp\htdocs\wp1\wp-includes\plugin.php(212): WP_Hook->apply_filters('233426', Array) #2 C:\xampp\htdocs\wp1\wp-content\plugins\woo-order-export-lite\classes\core\class-wc-order-export-engine.php(479): apply_filters('woe_order_expor...', '233426') #3 C:\xampp\htdocs\wp1\wp-content\plugins\woo-order-export-lite\classes\admin\tabs\ajax\trait-wc-order-export-admin-tab-abstract-ajax-export.php(25): WC_Order_Export_Engine::build_file(Array, 'preview', 'browser', 0, '5') #4 C:\xampp\htdocs\wp1\wp-content\plugins\woo-order-export-lite\classes\class-wc-order-export-admin.php(511): WC_Order_Export_Admin_Tab_Abstract->ajax_preview() #5 C:\xampp\htdocs\wp1\wp-includes\class-wp-hook.php(292): WC_Order_Expo in C:\xampp\htdocs\wp1\wp-content\plugins\woo-order-export-lite\classes\core\class-wc-order-export-engine.php(345) : eval()'d code on line 4
-
This reply was modified 3 years, 5 months ago by dnex11.