M
M
makaromax232019-09-04 18:19:00
WordPress
makaromax23, 2019-09-04 18:19:00

How to hide the number of items in the cart that is in the Woocomerce header?

Good afternoon. I have a question of the following nature. I am making an online store. Based on the theme of storefront and woocomerce. There is a shopping cart in the header of my website.
5d6fd54810165381618632.png
And it displays two values ​​price and quantity of goods. So, how to make the quantity of goods not displayed when it is equal to 0, and if it is greater than zero, then the value is displayed in a red circle (I attach the screen)
I found a code that displays just these numbers, but I can’t figure out how to write a condition. Please help me in this matter.

<span class="count"><?php echo wp_kses_data( sprintf( WC()->cart->get_cart_contents_count() ) ); ?></span>
https://pastie.ru/view/dfb9e2ad

5d6fd5ab82bb0239653172.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question