Loading...

Display Zero Tax Rate On Printable Invoices

Emilian F. Published on 22 August, 2014

If you have European customers then the invoice has to display the VAT (Value Added Tax) amount even if that amount is zero. By default Bigcommerce removes the tax line if there is no tax to be paid which is a reasonable default option. Unfortunately this generates additional headaches in your order fulfillment process as you have to manually add the tax line to the invoice. The article below will solve this problem by adding a separate tax line using Javascript.

Instructions

  1. Login to your control panel and navigate to Design -> Theme Files/Edit HTML & CSS and open the invoice_print.html file.

  2. Paste the following code at the bottom of the file:

  3. 
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
    var mcbool = $("tr[class*=InvoiceTax] td.Title").html();
    
    if (typeof mcbool === 'undefined') {
    var mcamount = $("tr[class*=InvoiceTotal] td.Total").text();
    var mcpos = mcamount.lastIndexOf(" ");
    var mcstr = mcamount.substr(mcpos,mcamount.length);
    
    
    $("tbody.InvoiceTotals").after("<tr class='InvoiceTax-Test InvoiceTotalRow'><td class='Title' colspan='4'>Tax Included in Total:</td><td class='Total'> 0 " + mcstr + "</td></tr>");
    
            }
    });
    </script>
    
    

  4. Save your changes, and test the modification by printing an invoice.

How It Works

The code modifies the invoice by adding a new tax line with a value of zero after the grand total. It will only add this line if the invoice does not have a tax. In the case your invoice does have a tax amount then it will not add the line.

Troubleshooting

If the tax line does not show up on the invoice... then double check the code. Make sure you copied it exactly as shown in the instructions. Be especially sure that the code contains the first line: $(document).ready(function(). If the code was copied correctly then it most likely is an issue with modifications done to the printable invoice template. In that case you will need to contact us to come up with a solution.

Emilian F. Published on 22 August, 2014