Adding product option quantities
-
Hello,
I’m trying to create a calculator that adds up the total amount of user-defined chocolates before ordering. It’s basically a build-a-box chocolate configurator.
Here: https://160.153.93.138/cielomio/wordpress/product/hand-painted-cielo-chocolate-bonbons/
I wrote some jquery that works on a standard HTML page but won’t work within woocommerce.
<script type=”text/javascript”>
$(document).ready(function () {
var $selects = $(“select”).change(function (e) {
var total = 0;
$selects.each(function() {
var val = this.value.match(/^[\d]+$/);
total += val ? +val[1] : 0;
});
$(“#total”).val(total);
});
});
</script>It doesn’t work.
Any ideas on getting this to work or do you have a better idea?
Thank you
Dennis
- The topic ‘Adding product option quantities’ is closed to new replies.