WooCommerce Waitlist

With WooCommerce Waitlist customers can register for email notifications when out-of-stock products become available.

Pass the WC_Product object to the wcwl_join_waitlist_message_text filter

Hi all, thanks for this great plugin!

I need to be able to change the message text for the waitlist depending on various product criteria. If you could pass in the wcwl_get_intro_text function, that would make that possible. See example code:

/**
* Get the default intro text to display above the waitlist dependent on product type
*
* @param WC_Product $product the product.
* @param string $product_type simple/variation/grouped (variation is the same as simple by default).
* @param bool $user_is_on_waitlist is user on waitlist.
*
* @return mixed|void
*/
function wcwl_get_intro_text( $product, $product_type = ‘simple’, $user_is_on_waitlist = false ) {
$context = ‘join’;
$text = __( ‘Join the waitlist to be emailed when this product becomes available’, ‘woocommerce-waitlist’ );
if ( $user_is_on_waitlist ) {
$context = ‘leave’;
$text = __( ‘You are on the waitlist for this product’, ‘woocommerce-waitlist’ );
} elseif ( ‘grouped’ === $product_type || ‘event’ === $product_type ) {
$context = $product_type;
$text = __( ‘Check the box alongside any Out of Stock products and update the waitlist to be emailed when those products become available’, ‘woocommerce-waitlist’ );
}

return apply_filters( ‘wcwl_’ . $context . ‘_waitlist_message_text’, $text, $product );
}

Thanks!
Dustin

Author

dustinparkerdev

Current Status

Open

Last updated: January 26, 2023

0 comments

Log in to comment on this feature request.