WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Dynamic Cart Icon in Header (6 posts)

  1. emike09
    Member
    Posted 1 year ago #

    Hi all,
    I'm looking to make our cart icon in the page header dynamic, so that as a user adds items to the cart, the icon displays the amount of items. Is there any way to go about this?

    http://wordpress.org/extend/plugins/woocommerce/

  2. bheadrick
    Member
    Posted 1 year ago #

    yes. I created a simple plugin to do this. It actually updates the qty via ajax so it's safe to use with page caching. It uses jquery to append the cart quantity within parentheses next to any link to the cart page.

    Ajax Cart Quantity

  3. bheadrick
    Member
    Posted 1 year ago #

    currently, it only updates on page load, so if you're using ajax add-to-cart, it won't update immediately, but it wouldn't take much to add that functionality.

  4. emike09
    Member
    Posted 1 year ago #

    Brilliant. You're a genius. Thanks a ton, I'll give it a try.

  5. emike09
    Member
    Posted 1 year ago #

    So I've got the plugin activated, but how do I go about updating the icon in my header with it?

  6. bheadrick
    Member
    Posted 1 year ago #

    there's nothing to do - no interface at all - it will automatically append the cart quantity to any link to the cart - so if you have a cart linked in your menu, for example, it will display
    CART (0)
    Shortly after the page loads if the plugin is activated.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.