JQuery if, first one free logic
<p>Ok so I writ some JQuery for updating a price live when a user adds an extra. There is one chunk of code for Booster Seats and one for Child Seats. </p>

<p>Here is one, so you can see exactly what I do:</p>

<pre><code>    $('.boostseat').change(function() {
        //sets the var id as the id of the select box
        var id = this.id;
        //sets this as the value of the select box
        numberofboostseat = $(this).val();
        //shows a confirmation message
        $('#boostseatadd-'+id).show();
        //this handles if an item is removed, so that the value doesn't reset
        if (typeof(boosttotal) != "undefined" &amp;&amp; boosttotal !== null) {
            price = $("#hiddenprice").val() - boosttotal;
        }else{
            price = $("#hiddenprice").val();
        }
        //number of days you hire it for cariable
        numofdays = "&lt;?php echo $length-&gt;days; ?&gt;";
        if (numofdays &gt; 4){
            //alert ("boost if1");
            boostcost = Number(20);

        }else if ((numberofboostseat == 1 || numberofboostseat == 0) &amp;&amp; (numberofchildseat == "undefined" || numberofchildseat == 0)){

            //alert ("boost if2");
            boostcost = Number(3) * Number(0);

        }else if (numofdays &lt; 1){
            //alert ("boost if3");
            boostcost = Number(3) * Number(1);

        }else{
            //alert ("boost if4");
            boostcost = Number(3) * Number(numofdays);
        }


        // determines final price
        boosttotal = Number(numberofboostseat) * Number(boostcost);
        //more varaibles 
        newprice = Number(price) + Number(boosttotal);
        //updates hiddden fields
        $("input#hiddenboostprice").val(boosttotal);
        $("input#hiddenboostnum").val(numberofboostseat);
        $("input#hiddenprice").val(newprice);

        oldnumofboost = $("input#hiddenboostnum").val(numberofboostseat);
        //updates the HTML (Live Price Update) as decimal
        $('#'+id).html("&amp;euro;" + newprice.toFixed(2));


    });

});
</code></pre>

<p>I've tried to comment it a bit to make it clearer. There is another chunk of code like this that handles child seats.</p>

<p>My problem is the the first childseat <strong>OR</strong> booster seat is free. </p>

<p>I tried this:</p>

<pre><code>}else if ((numberofboostseat == 1 || numberofboostseat == 0) &amp;&amp; (numberofchildseat == "undefined" || numberofchildseat == 0)){
</code></pre>

<p>As you can see above, the variable boostcost counts the cost of the seats. The other chunk of code, the childseat one also has global variables i can use, similar to these.</p>

<p>Can anyone suggest an if statement that would effectively make the first child OR booster seat free?</p>
