Cart item count

Hello,

I followed this tutorial and successfully created a cart item counter:

But what I want to achieve is to:

When there’s NO product in cart, I don’t want the item count to show.
LIKE THIS: https://prnt.sc/tFFzedFnNvar


BUT when I add a product, the cart item count shows.
LIKE THIS: https://prnt.sc/9_luRZuOaqNU

How can I do that please?

Hello @Kata789,

Thanks for writing to us.

I would suggest you please set the condition on the icon(Set the condition on the element where you have called the cart Icon) like this. Please have a look at the given screenshot below.
Customheader-Header-Cornerstone

On the given screenshot if the number of carts it would be greater than “0” then it would show the Icon.

The number of cart items can be pulled from this dynamic content code {{dc:woocommerce:cart_items_raw}}

In case you have not seen the condition and assignment doc please have a look at it.

Hope it helps
Thanks

Hi Prakash,

Thanks for your reply,

The item counter is actually a text with a short code, please take a look: https://prnt.sc/SpXAYDM37DO9

From the video above I sent you the tutorial shows that part at 1:55

I’m not sure how do I set a condition for that… can you help me, please?

Hello @Kata789,

In order to help you with your concerns we need to check your settings, please share your details in a secure note. Please provide the following details

  • WordPress Login URL
  • Admin-level username and password
  • Exact page URL

You can find the Secure Note button at the bottom of your posts

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.