Added fallback to company name if names are not specified

Use case described in Issue #10666
This commit is contained in:
Dev49.net 2016-04-11 04:13:46 +02:00
parent 00c3bf9ce3
commit 5eb3888045
1 changed files with 2 additions and 0 deletions

View File

@ -750,6 +750,8 @@ class WC_Admin_Post_Types {
} else { } else {
if ( $the_order->billing_first_name || $the_order->billing_last_name ) { if ( $the_order->billing_first_name || $the_order->billing_last_name ) {
$username = trim( sprintf( _x( '%1$s %2$s', 'full name', 'woocommerce' ), $the_order->billing_first_name, $the_order->billing_last_name ) ); $username = trim( sprintf( _x( '%1$s %2$s', 'full name', 'woocommerce' ), $the_order->billing_first_name, $the_order->billing_last_name ) );
} else if ( $the_order->billing_company ) {
$username = trim( $the_order->billing_company );
} else { } else {
$username = __( 'Guest', 'woocommerce' ); $username = __( 'Guest', 'woocommerce' );
} }