Removing VAT (20%) from accessories when region VAT not application
<p>I'm already removing the VAT from the total price but can't quite get it removed from the spares. Using a wordpress base with just an incredibly simple popup cart to take order details and throw them over to paypal.</p>

<pre><code>    $('.spare').click (function () {

    // get variables
    symbol = $('.symbol').val();
    spareid = $(this).attr("id").substring(5);
    sparename = $("#sparename"+spareid).val();
    spareprice = parseFloat($("#spareprice"+spareid).val());        
    sparetotal = $("#sparetotal").html();
    regionprice = parseInt($(".region").val());

    // Send accessories to Paypal
    // We need to count the accessories, add form items for each of them
    counter = (parseFloat($(".counter").val()))+1;

    // if this is first added spare, add text
    if (sparetotal.length &lt; 10) sparetotal="Accessories: &lt;br/&gt;";

    // add spare to display
    $("#sparetotal").html(
        sparetotal+
        sparename+": "+ 
        symbol+spareprice.toFixed(2)+
        "&lt;input type='hidden' name='accessory"+counter+"' value='"+sparename+"'/&gt;"+
        "&lt;input type='hidden' name='accessoryprice"+counter+"' value='"+spareprice+"'/&gt;&lt;br/&gt;"           
        );

    // update counter

    // update totals
    subtotal = parseFloat($('input.subtotal').val());
    subtotal = subtotal+spareprice; 
    $('.totaldisplay').html((subtotal+regionprice).toFixed(2));     
    $('input.subtotal').val(subtotal);
    $(".counter").val(counter);


});
});
</code></pre>

<p>Using another piece of JS to capture the clicks and add to the page:</p>

<pre><code>&lt;div class="right"&gt;
&lt;strong&gt;Spares and Accessories&lt;/strong&gt; Click to add.
&lt;br/&gt;
&lt;?
$custom_loop = new WP_Query('post_type=page&amp;post_parent=696');
if ( $custom_loop-&gt;have_posts() ) :

while ( $custom_loop-&gt;have_posts() ) : $custom_loop-&gt;the_post();

    $price = get_post_meta($post-&gt;ID , 'Product info: Product Price', true);

    echo "&lt;span class='spare' id='spare".get_the_id()."'&gt;".get_the_title();
    echo "&lt;input id='sparename".get_the_id()."' type='hidden' value='".get_the_title()."'/&gt;";
    echo "&lt;input id='spareprice".get_the_id()."' type='hidden' value='".fmtMoney($fx-&gt;toForeign($price))."'/&gt;";
    echo ": ".$symbol;
    echo fmtMoney($fx-&gt;toForeign($price));

echo "&lt;/span&gt;&lt;br/&gt;";
endwhile;
wp_reset_query();

endif;
</code></pre>

<p>This is my first post here and I'm wary. Be gentle.</p>

<ul>
<li>Stack</li>
</ul>
