Home Forums WoodMart support forum Hide “0” in empty cart and empty wishlist

Hide “0” in empty cart and empty wishlist

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #473118

    carpediemretaildoo
    Participant

    Hello,

    How can I remove “0” on the cart icon when there’s no item in shopping cart? I would like to show the item numbers only when user adds items to the cart.

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

    But it not working on ajax add to cart, refresh.
    I need to show number when it is not “0” and hide number badges when it is “0” but to work with ajax refresh cart.

    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
    }

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

    something like thos for woodmart?

    #473423

    Hello,

    Unfortunately, we cannot provide a custom code, the showing number of products is ensured by js and PHP

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

    Best Regards

    #473673

    carpediemretaildoo
    Participant

    OK,

    But can you consider that in future, I am not only one who need this 🙂

    #473696

    Hello,

    We definitely consider this feature for the future, at the same time we cannot promises we will implement that in the nearest updates.

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

    Best Regards

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