• I want to add a comment to individual products in the cart page. I am new to woocommerce so I have no idea how to do.

    I have done some research. In that tutorial,
    I found that I can use woocommerce_add_cart_item_data hook this way:

    add_filter( 'woocommerce_add_cart_item_data', 'add_comment', 10, 3 );
    
    function add_comment( $cart_item_data, $product_id, $variation_id ) {
    
        $cart_item_data['comment'] = 'This is comment';
    
        return $cart_item_data;
    
    }

    but this is not work in my case.

    Thank you.

  • The topic ‘How to add/update custom cart item data in the cart page’ is closed to new replies.