Error thrown

Call to undefined method WooCommerce::add_error()