1add_filter( 'woocommerce_add_to_cart_fragments', function($fragments) {
2
3 ob_start();
4 ?>
5
6 <div class="cart-contents">
7 <?php echo WC()->cart->get_cart_contents_count(); ?>
8 </div>
9
10 <?php $fragments['div.cart-contents'] = ob_get_clean();
11
12 return $fragments;
13
14} );
15
16add_filter( 'woocommerce_add_to_cart_fragments', function($fragments) {
17
18 ob_start();
19 ?>
20
21 <div class="header-quickcart">
22 <?php woocommerce_mini_cart(); ?>
23 </div>
24
25 <?php $fragments['div.header-quickcart'] = ob_get_clean();
26
27 return $fragments;
28
29} );