Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #522610

    Hi,
    I would like to display number of items in the cart in the header.
    There is a function:
    <a class="cart_dropdown_link" href="/cart/"><span aria-hidden="true" data-av_icon="" data-av_iconfont="entypo-fontello"></span><span class="av-cart-counter">0</span><span class="avia_hidden_link_text">Shopping Cart</span></a>

    Every time I add something to the cart, number of items in av-cart-counter element does not change.

    Could you please fix it?

    Thanks

    #522615

    I found the fix.

    #522616

    I found the solution. Change

    $output .= "<a class='cart_dropdown_link' href='".$link."'><span ".av_icon_string('cart')."></span><span class='av-cart-counter'>0</span><span class='avia_hidden_link_text'>".__('Shopping Cart','avia_framework')."</span></a><!--<span class='cart_subtotal'>".$cart_subtotal."</span>-->";
    to
    $output .= "<a class='cart_dropdown_link' href='".$link."'><span ".av_icon_string('cart')."></span><span class='av-cart-counter'>".$woocommerce->cart->cart_contents_count."</span><span class='avia_hidden_link_text'>".__('Shopping Cart','avia_framework')."</span></a><!--<span class='cart_subtotal'>".$cart_subtotal."</span>-->";

    in theme/config-woocommerce/config.php

    This won’t work for a child theme unfortunately.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Woocommerce header cart counter always empty’ is closed to new replies.