woocommerce_cart_item_visible filter-hookWC 2.1.0

Filter whether this cart item is visible in the cart.

Usage

add_filter( 'woocommerce_cart_item_visible', 'wp_kama_woocommerce_cart_item_visible_filter', 10, 3 );

/**
 * Function for `woocommerce_cart_item_visible` filter-hook.
 * 
 * @param bool   $visible       Whether the cart item is visible.
 * @param array  $cart_item     The cart item data.
 * @param string $cart_item_key The cart item key.
 *
 * @return bool
 */
function wp_kama_woocommerce_cart_item_visible_filter( $visible, $cart_item, $cart_item_key ){

	// filter...
	return $visible;
}
$visible(true|false)
Whether the cart item is visible.
Default: true
$cart_item(array)
The cart item data.
$cart_item_key(string)
The cart item key.

Changelog

Since 2.1.0 Introduced.

Where the hook is called

In file: /templates/cart/cart.php
woocommerce_cart_item_visible
woocommerce/templates/cart/cart.php 52
$visible = apply_filters( 'woocommerce_cart_item_visible', true, $cart_item, $cart_item_key );

Where the hook is used in WooCommerce

Usage not found.