add Additional class to woocommerce cart-contents link

You need to add your class of fi-shopping-cart to both instances of the cart link element: In the shorter, single-line snippet you’ve used your theme file, and in the the custom code you added to your functions.php file. If the custom class is present in only one snippet, it will be replaced when the other is loaded in.

The updated code is below. After making your changes, empty your cart, then add an item again. Woocommerce caches data, so the changes may not appear to work at first.

Here’s the code for functions.php – the only difference is that the icon class has been added as a class to the element:

<?php

// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php)
add_filter( 'woocommerce_add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment' );

function woocommerce_header_add_to_cart_fragment( $fragments ) {
    ob_start();
    ?>
    <a class="cart-contents fi-shopping-cart" href="https://wordpress.stackexchange.com/questions/191953/<?php echo WC()->cart->get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf (_n( '%d item', '%d items', WC()->cart->cart_contents_count ), WC()->cart->cart_contents_count ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a> 
    <?php

    $fragments['a.cart-contents'] = ob_get_clean();

    return $fragments;
}

And here’s the updated code for the cart link element for your theme file -you’ve already updated this, but it’s noted here for completeness:

<a class="cart-contents fi-shopping-cart" href="https://wordpress.stackexchange.com/questions/191953/<?php echo WC()->cart->get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf (_n( '%d item', '%d items', WC()->cart->cart_contents_count ), WC()->cart->cart_contents_count ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a>