How to Display Purchased Passwords for Custom Order Status

Requirements:

From version 1.3.0, PPWP WooCommerce Integration extension only shows the passwords or quick access links after buyers completed their purchases. In other words, only when the order status is completed will customers receive the passwords/ links to access the protected content.

If you want to display the passwords/links in a different stage of the order process or for a custom order status, simply add the following code snippet to your (child) theme’s functions.php file.

add_filter('ppwp_woo_supported_product_condition', 'ppwp_woo_check_order_status', 10, 2);
function ppwp_woo_check_order_status($is_virtual, $order)
{
	$status = $order->get_status();
	$status_whitelisted = ['processing', 'completed'];
	return in_array($status, $status_whitelisted);
}

You can add multiple values to display the passwords/links for more than one order statuses.

Lasted updated on April 12, 2021