WordPress at a glance
function is not described

wc_protected_product_add_to_cart() WC 1.0

Prevent password protected products being added to the cart.

No Hooks.

Return

true|false. Nothing.

Usage

wc_protected_product_add_to_cart( $passed, $product_id );
$passed(true|false) (required)
Validation.
$product_id(int) (required)
Product ID.

Code of wc_protected_product_add_to_cart() WC 5.2.2

<?php
function wc_protected_product_add_to_cart( $passed, $product_id ) {
	if ( post_password_required( $product_id ) ) {
		$passed = false;
		wc_add_notice( __( 'This product is protected and cannot be purchased.', 'woocommerce' ), 'error' );
	}
	return $passed;
}