Ajax Cart Count?

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

Hi guys, so i would like to count cart products in ajax.

I have gotten to a point where i have got a cart with count on it thanks to someone who helped on email and when i hover on it a cart items are displayed as drop down.

The problem however is that i can’t count it in ajax, if i remove a item in cart or add a item from store – it just doesnt update the count.

Thanks, any code help appreciated. โ˜บ

#66139

Hi there,

Can i see your site for details issue?

Can you provide login in private reply?

And send the code that you are using to count with the ajax to display the number on the cart .

Thanks

#66143
This reply has been marked as private.
#66398

Hi @Hasibul Amin Heme , any suggestions please?

Thankyou, ๐Ÿ™‚

#66471

Hi,

Seems like you are not using a function with filter hook of “add to cart”. so the cart is updating after refreshing the browser. You can try to add filter or action for add to cart button.

add_filter('wpdmpp_add_to_cart', 'wpdmpp_product_cart_count', 10, 2);
function wpdmpp_product_cart_count($id){    
     {do staff here}
    return $id;
}

Thanks

#66849

Hi , really sorry but i can’t seem to do this . I tried to put in the functions.php using my custom functions plugin.

May i know what i should do in the ” {do staff here} ” to kind of update it.?

Thanks ๐Ÿ™‚

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

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