Woocommerce Update Cart Ajax Hook Code Example


Example: woocommerce update mini cart ajax

add_filter( 'woocommerce_add_to_cart_fragments', function($fragments) {      ob_start();     ?>      <div class="cart-contents">         <?php echo WC()->cart->get_cart_contents_count(); ?>     </div>      <?php $fragments['div.cart-contents'] = ob_get_clean();      return $fragments;  } );  add_filter( 'woocommerce_add_to_cart_fragments', function($fragments) {      ob_start();     ?>      <div class="header-quickcart">         <?php woocommerce_mini_cart(); ?>     </div>      <?php $fragments['div.header-quickcart'] = ob_get_clean();      return $fragments;  } );

Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?