Automattic\WooCommerce\Blocks\Domain\Services
CheckoutLink::add_error_notices
Add error notices to the cart.
Method of the class: CheckoutLink{}
No Hooks.
Returns
null. Nothing (null).
Usage
// protected - for code of main (parent) or child class $result = $this->add_error_notices( $errors );
- $errors(WP_Error) (required)
- The errors.
CheckoutLink::add_error_notices() CheckoutLink::add error notices code WC 10.8.1
protected function add_error_notices( \WP_Error $errors ) {
foreach ( $errors->get_error_messages() as $message ) {
wc_add_notice( $message, 'error' );
}
}