• Resolved Silvio

    (@s_i_l_l_e)


    Hi,
    Is there a possibility to output the firstname an lastname in php own template?
    (wp-content/themes/hello-theme-child-master/woocommerce/pdf/yourtemplate)
    e.g. $this->billing_firstname()

    greetingxxxx

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Silvio

    (@s_i_l_l_e)

    Hi,
    I found the solution ??

    <?php $this->custom_field('billing_first_name');?>&nbsp; <?php $this->custom_field('billing_last_name');?>

    • This reply was modified 2 years, 10 months ago by Silvio.
    Thread Starter Silvio

    (@s_i_l_l_e)

    closed

    Plugin Contributor Ewout

    (@pomegranate)

    @s_i_l_l_e Those are actually order properties, not custom fields. While our plugin does provide fallback to order properties being erroneously called via the custom field method, it’s better to call the official WooCommerce methods directly:

    
    echo $order->get_billing_first_name(); // first name
    echo $order->get_billing_last_name(); // last name
    echo $order->get_formatted_billing_full_name(); // first name and last name combined
    

    Happy new year!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘billing_first_name / billing_last_name’ is closed to new replies.