Home Forums WoodMart support forum Cart Item Count

Cart Item Count

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #377914

    [email protected]
    Participant

    Hi,

    I would like to hide the cart item count if the cart is empty. I would also like to do this on the YITH Quote Icon.

    Thanks in adavance

    Attachments:
    You must be logged in to view attached files.
    #378037

    Hello,

    Sorry but there is no option in Theme Settings available for that.

    It requires customizations and this is beyond our limitations and support policy.

    Best Regards

    #378047

    [email protected]
    Participant

    Hi,

    Thanks for getting back to me. Could you not provide me with some code similar to what you provided for someone using your Basel theme as per the link below?

    https://xtemos.com/forums/topic/hide-0-in-empty-cart/

    Kind regards,

    #378128

    Hello,

    Please add this code to the functions.php of the child theme:

    function woodmart_cart_count() {
    	if ( ! is_object( WC() ) || ! property_exists( WC(), 'cart' ) || ! is_object( WC()->cart ) || !
    		method_exists( WC()->cart, 'get_cart_contents_count' ) || WC()->cart->cart_contents_count == 0 ) {
    		return;
    	}
    
    	$count = WC()->cart->get_cart_contents_count();
    	?>
    	<span class="wd-cart-number wd-tools-count<?php echo woodmart_get_old_classes( ' woodmart-cart-number' ); ?>"><?php echo esc_html( $count ); ?> <span><?php echo esc_html( _n( 'item', 'items', $count, 'woodmart' ) ); ?></span></span>
    	<?php
    }

    If you have any questions please feel free to contact us.

    Best Regards

    #378130

    [email protected]
    Participant

    That’s perfect, thanks a lot!

    Are you able to provide me with the code for the ‘YITH Request A Quote’ items count or will I need to ask them for the code?

    Many thanks,

    #378260

    Hello,

    Sorry but we could not help with third party plugins. You need to ask the plugin support for help.

    Let us know if there’s anything else we can do for you! You can always reach us at any time. We are always here to help you.

    Have a wonderful day.

    Topic Closed.
    Best Regards.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Cart Item Count’ is closed to new replies.