woocommerce_hide_invisible_variations filter-hookWC 1.0

Filter woocommerce_hide_invisible_variations optionally hide invisible variations (disabled variations and variations with empty price).

Usage

add_filter( 'woocommerce_hide_invisible_variations', 'wp_kama_woocommerce_hide_invisible_variations_filter', 10, 3 );

/**
 * Function for `woocommerce_hide_invisible_variations` filter-hook.
 * 
 * @param  $true      
 * @param  $id        
 * @param  $variation 
 *
 * @return 
 */
function wp_kama_woocommerce_hide_invisible_variations_filter( $true, $id, $variation ){

	// filter...
	return $true;
}
$true
-
$id
-
$variation
-

Where the hook is called

WC_Product_Variable::get_available_variations()
woocommerce_hide_invisible_variations
WC_Product_Variable::variation_is_available()
woocommerce_hide_invisible_variations
woocommerce/includes/class-wc-product-variable.php 307
if ( apply_filters( 'woocommerce_hide_invisible_variations', true, $this->get_id(), $variation ) && ! $variation->variation_is_visible() ) {
woocommerce/includes/class-wc-product-variable.php 339
if ( apply_filters( 'woocommerce_hide_invisible_variations', true, $this->get_id(), $variation ) && ! $variation->variation_is_visible() ) {

Where the hook is used in WooCommerce

Usage not found.