Skip to content

Commit

Permalink
If add qty field is empty set a default vallue of 1
Browse files Browse the repository at this point in the history
If add qty field is empty set a default vallue of 1

Solution is maybe not the most elegant but makes sure we don't overwrite existing values. Only oly if the fields is empty set a default value. A an improvement one could get the value from the mimimal_order_qty settings in settings (this is the way you set a default order qty value in frontend instead of leaving it empty)

please imagine use entering orders every day via adminhtml and every every time this fields is empty

a starting value of 1 already solves 95% of these cases

Major improvement for us, please accept
  • Loading branch information
seansan authored and Flyingmana committed Jan 9, 2017
1 parent fd14237 commit 34ab93c
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,13 @@
</dl>
</div>
</div>

<script type="text/javascript">
//<![CDATA[
var input = document.getElementById('product_composite_configure_input_qty');
if(input.value.length == 0) {
input.value = "1";
}
//]]>
</script>

0 comments on commit 34ab93c

Please sign in to comment.