Support » Plugin: F4 Salutation Fields for WooCommerce » Request Salutation

  • Resolved iananderson

    (@iananderson)


    Hi,
    I export my orders using WP All Export, and would like to include the Salutation field in my exported CSV file.
    How can I request the field in a PHP function? For example:
    function request_customer_title ($order) {
    $customer_title = get_post_meta($order, ‘_salutation’, true);
    return $customer_title;
    }
    Thanks for your help,
    Ian

Viewing 1 replies (of 1 total)
  • Plugin Author F4

    (@faktorvier)

    Hi @iananderson

    You can get the value (pretty similar to your example) with the following code:

    get_post_meta($order_id, '_billing_salutation', true)
    get_post_meta($order_id, '_shipping_salutation', true)

    That will get you the salutation codename. If you want the readable label, you could wrap the following method around the methods above:

    \F4\WCSF\Core\Hooks::get_option_label($salutation)

    How that helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Request Salutation’ is closed to new replies.