• Resolved dnex11

    (@dnex11)


    Some orders have no order note which is stored in wp_comments can I exclude those orders from being exported

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author algol.plus

    (@algolplus)

    Hello

    Please, visit https://docs.algolplus.com/algol_order_export/filters-orders/
    copy 1st code
    add to “Misc Settings”
    and tweak it

    use get_comments() to read order notes.
    we have example at page https://docs.algolplus.com/algol_order_export/add-new-fields/

    Thread Starter dnex11

    (@dnex11)

    Great. Thank you , its a very good plugin.

    • This reply was modified 3 years, 5 months ago by dnex11.
    Plugin Author algol.plus

    (@algolplus)

    you’re welcome

    Thread Starter dnex11

    (@dnex11)

    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.
    Plugin Author algol.plus

    (@algolplus)

    Hello

    please, visit page https://docs.algolplus.com/algol_order_export/add-new-fields/
    and seek for “get_comments”

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to exclude orders which has no order note’ is closed to new replies.