• Hello, I am using some external plugins and functionality, which still takes “order_id”. I would like to remake it to take order_number, generated by your plugin. Which variable should I use instead of $order_id? Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • I have got a snippet like this:

    add_filter( 'woocommerce_bacs_account_fields', 'custom_bacs_account_field', 10, 2);
    function custom_bacs_account_field( $account_fields, $order_id ) {
        static $call_counter = 0;
        if($call_counter > 0 )  {
            return $account_fields;
        }
     
        $order = wc_get_order( $order_id );
        $account_fields['variable_symbol' ] = array(
                'label' => __('Variable symbol', 'hello-elementor'),
                'value' => $order_id
            );
        $call_counter++;
        return $account_fields;
    }

    I need remake $order_id (I suppose in function params and in ‘value’ =>… too?)

    Plugin Author tychesoftwares

    (@tychesoftwares)

    Hi @lavadesign,

    You can use below code for getting custom order numbers:

    $order_number = $order->get_order_number(); //where $order is an order object

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Name of variable with order number’ is closed to new replies.