parseFloat with IF statement
<p>I am trying to get <em>IF</em> statements working inside a variable...</p>

<p>Look at the text under <em>//paypal variables</em>...when I start with <strong>price: if(item.quantity="4")</strong></p>

<pre><code> product.find('.product-buy').click(function(e) {
                    //check if option is set
                    var option = $(this).attr('option') || '';
                    var item = {
                        group: product.parent().attr('id'),
                        id: product.attr('id'),
                        option: option || 'NA',
        LOOK HERE----&gt;&gt;&gt;   quantity: parseInt(product.attr('minimum'+option),10) || 1,
                        minimum: parseInt(product.attr('minimum'+option),10) || 1,
                        //TEST
                         gap: parseFloat(product.attr('gap'+option)),
                        //TEST

                        //paypal variables
                        name: product.attr('name'+option),

    AND HERE----&gt;&gt;&gt;   price: if(item.quantity="4")
                        {
                            parseFloat(product.attr('price'+option))
                            }
                            if(item.quantity="8")
                        {
                            parseFloat(product.attr('price2'+option))
                            }
                            if(item.quantity="12")
                        {
                            parseFloat(product.attr('price3'+option))
                            }

                        shipping: product.attr('shipping'+option),
                        number: product.attr('number'+option),
                        handling: product.attr('handling'+option)
                    };
                    addToCart(item,true);
                    e.preventDefault();
                }).fadeTo(0, 0.7).hover(hoverHandler(300, 1), hoverHandler(300, settings.buttonsOpacity));
              //set currency sign 
              if (settings.currencySign) {
                product.find('.product-currency').html(settings.currencySign);
              }
        });
</code></pre>

<p>So basicly, I want the item.price value to parseFloat the '<strong>price</strong>' attribute if the <strong>quantity</strong> attribute is equal to 4...to parseFloat the '<strong>price2</strong>' attribute if the <strong>quantity</strong> is equal to 8...and parseFloat the '<strong>price3</strong>' attribute if the <strong>quantity</strong> is equal to 12.</p>

<p>As you can see, for now I tried :</p>

<pre><code>                    price: if(item.quantity="4")
                    {
                        parseFloat(product.attr('price'+option))
                        }
                        if(item.quantity="8")
                    {
                        parseFloat(product.attr('price2'+option))
                        }
                        if(item.quantity="12")
                    {
                        parseFloat(product.attr('price3'+option))
                        }
</code></pre>

<p>But it's not working. Any ideas?</p>

<p>thank you!</p>
