Skip to content

Instantly share code, notes, and snippets.

@mrjjwright
Created April 19, 2011 15:57
Show Gist options
  • Select an option

  • Save mrjjwright/928581 to your computer and use it in GitHub Desktop.

Select an option

Save mrjjwright/928581 to your computer and use it in GitHub Desktop.
Shows the number ordered over a product item after an item has been added to a cart.
$('.product-order a').bind("ajax:success", function(e, lineItemQuantity){
var $this = $(this),
$confirmObj = $this.parent('.product-order').siblings('.product-image').children('.order-over');
if( !$confirmObj.is('visible') && !($confirmObj.is('animated')) ){
$confirmObj.fadeIn();
$confirmObj.children('p').children('.order-count').text(lineItemQuantity);
setTimeout( function(){$confirmObj.fadeOut();}, 3000);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment