woocommerce_get_cart_item_from_session, $session_data, $values, $key

woocommerce_get_cart_item_from_session, $session_data, $values, $key

Appears in:
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.11.0.0

apply_filters('woocommerce_get_cart_item_from_session, $session_data, $values, $key') is found 1 times:

  • /includes/class-wc-cart-session.php line 250
    				 * @param array  $session_data Data for an item in the cart.
    				 * @param array  $values       Data for an item in the cart, without the product object.
    				 * @param string $key          The cart item hash.
    				 */
    				$cart_contents[ $key ] = apply_filters( 'woocommerce_get_cart_item_from_session', $session_data, $values, $key );
    				if ( ! isset( $cart_contents[ $key ]['data'] ) || ! $cart_contents[ $key ]['data'] instanceof WC_Product ) {
    					// If the cart contents is missing the product object after filtering, something is wrong.
    					wc_doing_it_wrong(
    						__METHOD__,
    						'When filtering cart items with woocommerce_get_cart_item_from_session, each item must have a data key containing a product object.',
    						'9.8.0'