Thread Starter
Jan444
(@ign2009)
I’m not sure if it was a cache problem, it could be.
The minicart requires the browser cache to be cleared (or it requires to add a new product to it) if you do html changes to overwrite it on a child theme.
Now my code is working and it could be a cache issue as stated, or maybe this code, that I added to functions.php:
function iconic_cart_count_fragments( $fragments ) {
$fragments['div.header-cart-count'] = '<div class="header-cart-count">' . WC()->cart->get_cart_contents_count() . '</div>';
return $fragments;
if ( ! WC()->cart->is_empty() ) {
$fragments['div.header-cart-count'] = '<div class="header-cart-count">' . WC()->cart->get_cart_contents_count() . '</div>';
return $fragments;
}else{
$fragments['div.header-cart-count'] = '<div class="header-cart-count">L</div>';
return $fragments;
}
}
-
This reply was modified 6 years, 3 months ago by
Jan444.
-
This reply was modified 6 years, 3 months ago by
Jan444.
-
This reply was modified 6 years, 3 months ago by
Jan444.
-
This reply was modified 6 years, 3 months ago by
Jan444.
Hi there,
I’m glad to hear your code is now working and you were able to narrow down what the possible cause of the issue was!
I’m going to mark this thread as resolved.
If you have any further questions, please start a new thread.
Have a wonderful day!