woocommerce_variation_is_visible хук-фильтрWC 1.0

Checks if this particular variation is visible. Invisible variations are enabled and can be selected, but no price / stock info is displayed. Instead, a suitable 'unavailable' message is displayed. Invisible by default: Disabled variations and variations with an empty price.

Использование

add_filter( 'woocommerce_variation_is_visible', 'wp_kama_woocommerce_variation_is_visible_filter', 10, 4 );

/**
 * Function for `woocommerce_variation_is_visible` filter-hook.
 * 
 * @param  $condition 
 * @param  $id        
 * @param  $parent_id 
 * @param  $that      
 *
 * @return 
 */
function wp_kama_woocommerce_variation_is_visible_filter( $condition, $id, $parent_id, $that ){

	// filter...
	return $condition;
}
$condition
-
$id
-
$parent_id
-
$that
-

Где вызывается хук

WC_Product_Variation::variation_is_visible()
woocommerce_variation_is_visible
woocommerce/includes/class-wc-product-variation.php 572
return apply_filters( 'woocommerce_variation_is_visible', 'publish' === get_post_status( $this->get_id() ) && '' !== $this->get_price(), $this->get_id(), $this->get_parent_id(), $this );

Где используется хук в WooCommerce

Использование не найдено.