Created
June 8, 2011 17:59
-
-
Save carolineschnapp/1014941 to your computer and use it in GitHub Desktop.
tiered-pricing.liquid
This file contains 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
<script> | |
if (typeof jQuery === 'undefined') { | |
document.write('<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"><\/script>'); | |
document.write('<script type="text/javascript">jQuery.noConflict();<\/script>'); | |
} | |
</script> | |
{% if needs_update %} | |
<script type="text/javascript"> | |
jQuery('form[action="/cart"]').get(0).submit(); | |
</script> | |
{% endif %} | |
<script type="text/javascript"> | |
jQuery(function() { | |
jQuery(':text[name^=updates]').change(function() { | |
var min = parseInt(jQuery(this).attr('min'), 10) || 0; | |
var max = parseInt(jQuery(this).attr('max'), 10) || 9999999; | |
var qty = parseInt(jQuery(this).val(), 10); | |
if (qty < min) { | |
jQuery(this).val(min); | |
} | |
else if (qty > max) { | |
jQuery(this).val(max); | |
} | |
return true; | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment