Woocommerce – display message to specific shipping class

I would like to display message when a customer selects specific shipping class.

add_action( 'woocommerce_before_calculate_totals', 'cart_items_shipping_class_message', 20, 1 );
function cart_items_shipping_class_message( $cart ){
    foreach( $cart->get_cart() as $cart_item ){
        $shipclass = $cart_item->get_shipping_class_id();
        if ($shipclass == 14) {
            echo "In the order note, write the address of the Mail Order or ZBox where you want to deliver the order";
        }
        }
    }

It does not work and I cant find the right solution. I will be thrilled if you can advise me.