Title: bvarba's Replies | WordPress.org

---

# bvarba

  [  ](https://wordpress.org/support/users/bvarba/)

 *   [Profile](https://wordpress.org/support/users/bvarba/)
 *   [Topics Started](https://wordpress.org/support/users/bvarba/topics/)
 *   [Replies Created](https://wordpress.org/support/users/bvarba/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/bvarba/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/bvarba/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/bvarba/engagements/)
 *   [Favorites](https://wordpress.org/support/users/bvarba/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Show cart contents / total do not work with WooCommerce Version 2.3](https://wordpress.org/support/topic/show-cart-contents-total-do-not-work-with-woocommerce-version-23/)
 *  [bvarba](https://wordpress.org/support/users/bvarba/)
 * (@bvarba)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/show-cart-contents-total-do-not-work-with-woocommerce-version-23/#post-5497809)
 * Hey coolcoder,
 * you are a savior! Thanks a lot man. It was no where apparent that ‘add_to_cart_fragments’
   is deprecated.
 *     ```
       function woocommerce_header_add_to_cart_fragment( $fragments )
       {
           global $woocommerce;
           ob_start(); ?>
   
           <a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> <?php echo $woocommerce->cart->get_cart_total(); ?></a>
   
           <?php
           $fragments['a.cart-contents'] = ob_get_clean();
           return $fragments;
       }
       ?>
       ```
   
 * and
 *     ```
       <a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> - <?php echo $woocommerce->cart->get_cart_total(); ?></a>
       ```
   
 * did it for me.

Viewing 1 replies (of 1 total)