WC_Order::set_billing_last_name PHP Method

set_billing_last_name() public method

Set billing_last_name.
public set_billing_last_name ( string $value )
$value string
    public function set_billing_last_name($value)
    {
        $this->set_address_prop('last_name', 'billing', $value);
    }

Usage Example

示例#1
0
 /**
  * Test: get_formatted_billing_address
  */
 function test_get_formatted_billing_address()
 {
     $object = new WC_Order();
     $object->set_billing_first_name('Fred');
     $object->set_billing_last_name('Flintstone');
     $object->set_billing_company('Bedrock Ltd.');
     $object->set_billing_address_1('34 Stonepants avenue');
     $object->set_billing_address_2('Rockville');
     $object->set_billing_city('Bedrock');
     $object->set_billing_state('Boulder');
     $object->set_billing_postcode('00001');
     $object->set_billing_country('US');
     $this->assertEquals('Fred Flintstone<br/>Bedrock Ltd.<br/>34 Stonepants avenue<br/>Rockville<br/>Bedrock, BOULDER 00001<br/>United States (US)', $object->get_formatted_billing_address());
 }
WC_Order