Is there a way to hide or show a field on my website based on the value in the shopping cart? I've created a function for this, but I'm struggling with the condition. Can you help me figure out how to write it correctly?
<script>
$(document).ready(function() {
function updateTextFieldVisibility() {
var textField = $('#grid-2');
if ($('#grid-12-12-12').val() > 0) {
textField.show();
} else {
textField.hide();
}
}
});
</script>