woocommerce_cart_item_name
This filter is documented above.
Использование
add_filter( 'woocommerce_cart_item_name', 'wp_kama_woocommerce_cart_item_name_filter', 10, 3 ); /** * Function for `woocommerce_cart_item_name` filter-hook. * * @param $sprintf * @param $cart_item * @param $cart_item_key * * @return */ function wp_kama_woocommerce_cart_item_name_filter( $sprintf, $cart_item, $cart_item_key ){ // filter... return $sprintf; }
- $sprintf
- -
- $cart_item
- -
- $cart_item_key
- -
Список изменений
С версии 2.1.0 | Введена. |
Где вызывается хук
В файле: /templates/cart/cart.php
woocommerce_cart_item_name
woocommerce/templates/cart/cart.php 97
echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', sprintf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $_product->get_name() ), $cart_item, $cart_item_key ) );
woocommerce/templates/cart/cart.php 51
$product_name = apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key );
woocommerce/templates/cart/mini-cart.php 40
$product_name = apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key );
woocommerce/templates/checkout/review-order.php 38
<?php echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ) ) . ' '; ?>