add_filter to modify woocommerce_cart_item_name hyperlink
The key is to pass arguments to the callback function. Try this: /* Function that returns custom product hyperlink */ function wc_cart_item_name_hyperlink( $link_text, $product_data ) { $title = get_the_title($product_data[‘product_id’]); return sprintf( ‘<a href=”https://wordpress.stackexchange.com/questions/216353/%s”>%s </a>’,’example.com/mypage/’,$title ); } /* Filter to override cart_item_name */ add_filter( ‘woocommerce_cart_item_name’, ‘wc_cart_item_name_hyperlink’, 10, 2 ); The $product_data parameter is an array that … Read more