Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery('.addtocart').each(function() {
- var $self = jQuery(this),
- oldOnClick = $self.attr('onclick'),
- $product = $self.closest('.item');
- $self.attr('data-onclick', oldOnClick).removeAttr('onclick');
- $self.off('click').on('click', function() {
- if($product.find('.input-text.qty').val() < 1)
- return false;
- else
- eval(jQuery(this).data('onclick'));
- });
- });
Add Comment
Please, Sign In to add comment