Hi Charlie,
I am not sure if this is a bug, or something which would benefit from refinement.
Having just changed my Cart Off Canvas from using the Cart Off Canvas’s text toggle to bring through dynamic content to bring through the cart_item_count, I have just changed it to the setup in @DoncoMarketing’s latest video.
I have added a minor refinement to the Cart Item Count
div, by setting a condition against that div to hide the item count and its background, if the cart is empty.
To do this, I have set a condition in the div Cart Item Count
, which is number
and then {{dc:woocommerce:cart_items_raw}} > 0
On the front end, with the cart empty, if I refresh the page, the condition works correctly and the item count div does not display:
If I now add an item to the cart, the count successfully displays:
However, if I remove the item from the cart, the count still displays with 0
as the quantity, even though it should not be shown:
If I refresh the page with the cart still empty, the item count is not displayed - the behaviour I had hoped for in the previous step.
It seems that the Cart Off Canvas element allows the condition to act correctly when items are added to the cart, but does not allow the condition to work when the cart is emptied.
Is this a behaviour, which can be rectified in the element, or is it something we need to accept as it is?
Many thanks,
Christopher