Automattic\WooCommerce\Internal\StockNotifications\Frontend

ProductPageIntegration::display_already_signed_uppublicWC 1.0

Display the already signed up message.

Method of the class: ProductPageIntegration{}

Returns

null. Nothing (null).

Usage

$ProductPageIntegration = new ProductPageIntegration();
$ProductPageIntegration->display_already_signed_up( $product, $notification ): void;
$product(WC_Product) (required)
Product object.
$notification(Notification) (required)
Notification object.

ProductPageIntegration::display_already_signed_up() code WC 10.3.6

public function display_already_signed_up( WC_Product $product, Notification $notification ): void {

	/**
	 * Filter the already signed up message HTML.
	 *
	 * @since 10.2.0
	 *
	 * @param string|null  $pre The message.
	 * @param WC_Product   $product Product object.
	 * @param Notification $notification Notification object.
	 * @return string|null The message.
	 */
	$pre = apply_filters( 'woocommerce_customer_stock_notifications_already_signed_up_message_html', null, $product, $notification );
	if ( ! is_null( $pre ) ) {
		echo wp_kses_post( $pre );
		return;
	}

	$text = __( 'You have already joined the waitlist! Click {manage_account_link} to manage your notifications.', 'woocommerce' );
	$text = str_replace( '{manage_account_link}', '<a href="' . wc_get_account_endpoint_url( 'stock-notifications' ) . '">' . _x( 'here', 'back in stock form', 'woocommerce' ) . '</a>', $text );
	wc_print_notice( $text, 'notice' );
}