woocommerce_cart_item_name
The WooCommerce Rejoiner woocommerce cart item name hook.
Description
apply_filters( 'woocommerce_cart_item_name', (unknown) $product_get_title, (unknown) $cart_item, (unknown) $cart_item_key );
Parameters (3)
- 0. $product_get_title (unknown)
- The product get title.
- 1. $cart_item (unknown)
- The cart item.
- 2. $cart_item_key (unknown)
- The cart item key.
Usage
- To run the hook, copy the example below.
- $product_get_title = apply_filters( 'woocommerce_cart_item_name', $product_get_title, $cart_item, $cart_item_key );
- if ( !empty( $product_get_title ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the woocommerce_cart_item_name callback
- function filter_woocommerce_cart_item_name( $product_get_title, $cart_item, $cart_item_key ) {
- // make filter magic happen here...
- return $product_get_title;
- };
- // add the filter
- add_filter( 'woocommerce_cart_item_name', 'filter_woocommerce_cart_item_name', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'woocommerce_cart_item_name', 'filter_woocommerce_cart_item_name', 10, 3 );
Defined (3)
The filter is defined in the following location(s).
- /includes/class-wc-rejoiner.php
- $item_name = apply_filters( 'woocommerce_cart_item_name', $_product->get_title(), $cart_item, $cart_item_key ) . $variant;
- 'name' => $this->escape_for_json( apply_filters( 'woocommerce_cart_item_name', $_product->get_title(), $cart_item, $cart_item_key ) ),
- 'name' => $this->escape_for_json( apply_filters( 'woocommerce_cart_item_name', $_product->get_title() ) ),