WC_Order::get_order_key PHP Method

get_order_key() public method

Get order key.
Since: 2.7.0
public get_order_key ( string $context = 'view' ) : string
$context string
return string
    public function get_order_key($context = 'view')
    {
        return $this->get_prop('order_key', $context);
    }

Usage Example

Beispiel #1
0
 /**
  * Test: get_checkout_order_received_url
  */
 function test_get_checkout_order_received_url()
 {
     $object = new WC_Order();
     $object->set_order_key('xxx');
     $id = $object->save();
     $this->assertEquals('http://example.org?order-received=' . $id . '&key=' . $object->get_order_key(), $object->get_checkout_order_received_url());
 }
All Usage Examples Of WC_Order::get_order_key
WC_Order