WC_Order::has_cart_hash PHP Method

has_cart_hash() public method

See if order matches cart_hash.
public has_cart_hash ( $cart_hash = '' ) : boolean
return boolean
    public function has_cart_hash($cart_hash = '')
    {
        return hash_equals($this->get_cart_hash(), $cart_hash);
    }

Usage Example

Example #1
0
 /**
  * Test: has_cart_hash
  */
 function test_has_cart_hash()
 {
     $object = new WC_Order();
     $this->assertFalse($object->has_cart_hash('12345'));
     $set_to = '12345';
     $object->set_cart_hash($set_to);
     $this->assertTrue($object->has_cart_hash('12345'));
 }
WC_Order