Just a small Mod that you might find useful...
As you see in price field users are able to write anything (dfds7678*&*...) - Not just numbers.
Follow these steps to allow users to enter only numerical values (1234566)
In this tutorial I'm explaining how to do that in Bender theme but it should be similar in other themes.
Open item.php file from your theme folder
Find this code
<?php if( osc_price_enabled_at_items() ) { ?>
<div class="control-group">
<label class="control-label" for="price"><?php _e('Price', 'bender'); ?></label>
<div class="controls">
<?php ItemForm::price_input_text(); ?>
<?php ItemForm::currency_select(); ?>
</div>
</div>
<?php } ?>
And replace it with this
<?php if( osc_price_enabled_at_items() ) { ?>
<div class="control-group">
<label class="control-label" for="price"><?php _e('Price', 'bender'); ?>(Numbers Only)</label>
<div class="controls" id="nbr">
<?php ItemForm::price_input_text(); ?>
<?php ItemForm::currency_select(); ?>
</div>
</div>
<script type="text/javascript">
$('#nbr').on('keypress', function(ev) {
var keyCode = window.event ? ev.keyCode : ev.which;
//codes for 0-9
if (keyCode < 48 || keyCode > 57) {
//codes for backspace, delete, enter
if (keyCode != 0 && keyCode != 8 && keyCode != 13 && !ev.ctrlKey) {
ev.preventDefault();
}
}
});
</script>
<?php } ?>
Here you go!
Now users can only input numbers in the price field.
Regards,
ibthemes.com