Having problem implementing changes for the total quantity of products in the header mini cart.
Currently woocommerce calculate total qty for all products in cart:
echo WC()->cart->get_cart_contents_count();
We need a solution which will calculate qty for different products only. So we have modified code:
echo count(WC()->cart->get_cart());
That is working fine, qty is shown show by different products only, but now we have AJAX bug, spinner keep loading and page need a manual refresh. After refresh products are successfully added to cart and mini cart is updated with new product qty calc.
What could be a problem with stopping AJAX from working properly?