• Resolved rptr

    (@rptr)


    Hello,

    I am using this plugin in checkout. I am using also plugin for export invoices to external company and I have problem with export company billing details from orders. Company sends me function what I need to add to my site, but I dont know where I will find this data in your plugin. Can somebody help me please? Function and description is bellow… Thank you.

    FUNCTION:

    function my_client_data($client_data, $order) {
        $client_data['ico'] = '123';
        $client_data['dic'] = '456';
        $client_data['ic_dph'] = '789';
        return $client_data;
    }
    add_filter('sf_client_data', 'my_client_data', 10, 2);

    DATA FOR FUNCTION – ID OF FIELDS:

    123 - billing_company_number
    456 - billing_vat_number
    789 - billing_vat_number_2
Viewing 1 replies (of 1 total)
  • Plugin Author ThemeHigh

    (@themehigh)

    All the fields created using our plugin are saved as Order Meta Data.

    You can retrieve the data from the database using the below function:

    get_post_meta($order_id, 'field_name', true);

    You can also try the below code:

    function my_client_data($client_data, $order) {
        $client_data['ico'] = get_post_meta( $order->get_id(), 'billing_company_number', true );
        $client_data['dic'] = get_post_meta( $order->get_id(), 'billing_vat_number', true );
        $client_data['ic_dph'] = get_post_meta( $order->get_id(), 'billing_vat_number_2', true );
        return $client_data;
    }
    add_filter('sf_client_data', 'my_client_data', 10, 2);

    We hope this will help.

    Thank you!

Viewing 1 replies (of 1 total)
  • The topic ‘Where I will find name of $order fields?’ is closed to new replies.