Hi @maitrekou,
Thanks for reaching out!
Currently, WPForms doesn’t offer built-in options to customize the Quantity field increments or apply three decimal places on the unit price within a specific payment field or form. Both of these changes would require custom code.
For example, if you’re using the Dropdown Items field with the Modern style (screenshot), you can use a PHP snippet like this:
function wpf_dev_initialize_choices_js( ) {
?>
<script type="text/javascript">
// Check if Choices.js is not loaded and dynamically load it
if (typeof Choices === 'undefined') {
var script = document.createElement('script');
//script.src = WPFORMS_PLUGIN_URL + 'assets/lib/choices.min.js';
script.src = 'https://wpforms.local/wp-content/plugins/wpforms/assets/lib/choices.min.js';
script.onload = function() {
setupChoices();
};
document.head.appendChild(script);
} else {
setupChoices();
}
// Setup Choices.js for a specific select element
function setupChoices() {
var selectElement = document.getElementById('wpforms-85-field_3-quantity');
// Initialize Choices.js if it has not been applied yet
if (selectElement && !selectElement.hasAttribute('data-choices') ) {
var choices = new Choices(selectElement, {
searchEnabled: false,
itemSelectText: '',
shouldSort: false
});
// Populate select with options
choices.setChoices(function() {
var items = [];
// Create quantity options, incrementing by 100
for (var i = 100; i <= 1000; i += 100) {
items.push({value: i.toString(), label: i.toString(), selected: i === 100});
}
return items;
}, 'value', 'label', true);
}
}
</script>
<?php
}
add_action( 'wpforms_wp_footer_end', 'wpf_dev_initialize_choices_js', 30 );
Here is a screenshot of the result using this code snippet.
In case it helps, here’s our tutorial with the most common ways to add custom code like this. For the most beginner-friendly option in that tutorial, I’d recommend using the WPCode plugin.
However, I apologize as customizations like this are outside of our scope for support. In case you’d like to look into custom development options, we highly recommend posting your customization job here.
Thanks, and please let me know if you have other questions regarding WPForms Lite.