Created
November 8, 2012 18:15
-
-
Save objectivehtml/4040531 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('.add-to-cart').submit(function(e) { | |
| var form = $(this); | |
| var action = form.attr('action'); | |
| var post = {}; | |
| var urlTitle = FilterFarm.segment(3); | |
| form.find('input, select, textarea').each(function() { | |
| var $t = $(this); | |
| post[$t.attr('name')] = $t.val(); | |
| }); | |
| $('.cart-activity').css({ | |
| display: 'inline-block' | |
| }); | |
| $.post(action, post, function() { | |
| $.get('/store/cart/'+urlTitle, function(html) { | |
| $('.popover').html(html); | |
| $('a.cart').addClass('active').html($('.popover .total').html()+'<span class="icon-shopping-cart"></span>'); | |
| $('.popover').fadeIn(); | |
| $('.cart-activity').hide(); | |
| }); | |
| }, 'JSON'); | |
| e.preventDefault(); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment