Automattic\WooCommerce\Internal\OrderWithdrawal

OrderWithdrawalFeatureHighlightNotification::possibly_add_note │ public │ WC 1.0

Add the note if the store is eligible and it has never been created before.

Method of the class: OrderWithdrawalFeatureHighlightNotification{}

No Hooks.

Returns

null. Nothing (null).

Usage

$OrderWithdrawalFeatureHighlightNotification = new OrderWithdrawalFeatureHighlightNotification();
$OrderWithdrawalFeatureHighlightNotification->possibly_add_note(): void;

OrderWithdrawalFeatureHighlightNotification::possibly_add_note() code WC 11.3.0

public function possibly_add_note(): void {
	try {
		if ( $this->note_exists( self::NOTE_NAME ) ) {
			return;
		}

		if ( ! $this->is_applicable() ) {
			return;
		}

		$this->get_feature_highlight_note()->save();
	} catch ( Exception $exception ) {
		wc_get_logger()->error(
			'Unable to create the order withdrawal inbox notification.',
			array(
				'source'    => 'order-withdrawal',
				'exception' => $exception,
			)
		);
	}
}