woocommerce_cart_item_visible хук-фильтрWC 2.1.0

Filter whether this cart item is visible in the cart.

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

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.
По умолчанию: true
$cart_item(массив)
The cart item data.
$cart_item_key(строка)
The cart item key.

Список изменений

С версии 2.1.0 Введена.

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

В файле: /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 );

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

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