Skip to content

Instantly share code, notes, and snippets.

@aristath
Created July 25, 2013 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aristath/6080765 to your computer and use it in GitHub Desktop.
Save aristath/6080765 to your computer and use it in GitHub Desktop.
<div id="cart-ajax-wrapper">
<div id="cart-contents">
<?php mp_cart_link(); ?>
<span><?php echo sprintf(__('%s item(s)' ), mp_items_count_in_cart()); ?></span>
</div>
</div>
<script>
jQuery(document).ready(function() {
jQuery("#cart-ajax-wrapper").bind("html", function () {
jQuery("#cart-contents").load(window.location+" #cart-contents span");
}).initMutation('html');
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment