Jump to content

Display both with and without TAX Shopping Cart


Recommended Posts

Hi!

I am wondering if someone knows how to display both with and without tax in the shopping cart?

I want to show my customers both how much it costs with and without tax. Ex.

 

Total shipping cost: Free delivery!
Total order (ex. tax): 0000

Total order (incl. tax): 0000

Total order (should always be incl. tax)

Now when I have activated the ex. tax it duplicates. (see attached file)
 

Thank you in advance! 

post-1015994-0-13042200-1436772550_thumb.png

Edited by Ludwig1 (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
Hi,

 

In shopping-cart.tpl you will find

 

{if $use_taxes}

    <td colspan="2" class="price" id="total_price_container">

        <span id="total_price">{displayPrice price=$total_price}</span>

    </td>

        {else}

    <td colspan="2" class="price" id="total_price_container">

        <span id="total_price">{displayPrice price=$total_price_without_tax}</span>

    </td>

{/if}

 

This is the section that decides whether to display taxes,

 

To show both you would need remove the if else statement and modify the table to display both

 

{displayPrice price=$total_price} where you need tax inc price

 

 

{displayPrice price=$total_price_without_tax} where you need exc tax price

 

 

So you need to replace

 

<tr class="cart_total_price">

    <td colspan="{$col_span_subtotal}" class="total_price_container text-right">

    <span>{l s='Total'}</span>

    </td>

    {if $use_taxes}

    <td colspan="2" class="price" id="total_price_container">

    <span id="total_price">{displayPrice price=$total_price}</span>

    </td>

    {else}

    <td colspan="2" class="price" id="total_price_container">

    <span id="total_price">{displayPrice price=$total_price_without_tax}</span>

    </td>

    {/if}

</tr>

 

with

 

<tr class="cart_total_price">

    <td colspan="{$col_span_subtotal}" class="total_price_container text-right">

    <span>{l s='Total exc tax'}</span>

    </td>

    <td colspan="2" class="price" id="total_price_container">

    <span id="total_price">{displayPrice price=$total_price_without_tax}</span>

    </td>

    

</tr>

<tr  class="cart_total_price">

    <td colspan="{$col_span_subtotal}" class="total_price_container text-right">

    <span>{l s='Total inc tax'}</span>

    </td>

    <td colspan="2" class="price" id="total_price_container">

    <span id="total_price">{displayPrice price=$total_price}</span>

    </td>

</tr>

 

 

Regards

 

Clint

Edited by clint (see edit history)
Link to comment
Share on other sites

 

Hi,
 
In shopping-cart.tpl you will find
 
{if $use_taxes}
    <td colspan="2" class="price" id="total_price_container">
        <span id="total_price">{displayPrice price=$total_price}</span>
    </td>
        {else}
    <td colspan="2" class="price" id="total_price_container">
        <span id="total_price">{displayPrice price=$total_price_without_tax}</span>
    </td>
{/if}
 
This is the section that decides whether to display taxes,
 
To show both you would need remove the if else statement and modify the table to display both
 
{displayPrice price=$total_price} where you need tax inc price
 
 
{displayPrice price=$total_price_without_tax} where you need exc tax price
 
 
So you need to replace
 
<tr class="cart_total_price">
    <td colspan="{$col_span_subtotal}" class="total_price_container text-right">
    <span>{l s='Total'}</span>
    </td>
    {if $use_taxes}
    <td colspan="2" class="price" id="total_price_container">
    <span id="total_price">{displayPrice price=$total_price}</span>
    </td>
    {else}
    <td colspan="2" class="price" id="total_price_container">
    <span id="total_price">{displayPrice price=$total_price_without_tax}</span>
    </td>
    {/if}
</tr>
 
with
 
<tr class="cart_total_price">
    <td colspan="{$col_span_subtotal}" class="total_price_container text-right">
    <span>{l s='Total exc tax'}</span>
    </td>
    <td colspan="2" class="price" id="total_price_container">
    <span id="total_price">{displayPrice price=$total_price_without_tax}</span>
    </td>
    
</tr>
<tr  class="cart_total_price">
    <td colspan="{$col_span_subtotal}" class="total_price_container text-right">
    <span>{l s='Total inc tax'}</span>
    </td>
    <td colspan="2" class="price" id="total_price_container">
    <span id="total_price">{displayPrice price=$total_price}</span>
    </td>
</tr>
 
 
Regards
 
Clint

 

Hi Clint! Thank you very much for your support!

 

I tried back and forth to learn at first, and I did this:

{if $use_taxes && $show_taxes && $total_tax != 0 }
					{if $priceDisplay != 0}
					<tr class="cart_total_price">
						<td colspan="{$col_span_subtotal}" class="text-right">{if $display_tax_label}{l s='Total (inkl. moms)'}{else}{l s='Total'}{/if}</td>
						<td colspan="2" class="price" id="total_price_without_tax">{displayPrice price=$total_price}</td>
					</tr>
					{/if}
					<tr class="cart_total_tax">
						<td colspan="{$col_span_subtotal}" class="text-right">{l s='Tax'}</td>
						<td colspan="2" class="price" id="total_tax">{displayPrice price=$total_tax}</td>
					</tr>
				{/if}
				<tr class="cart_total_price">
					<td colspan="{$col_span_subtotal}" class="total_price_container text-right">
						<span>{l s='Total'}</span>
					</td>
					{if $use_taxes}
						<td colspan="2" class="price" id="total_price_container">
							<span id="total_price">{displayPrice price=$total_price}</span>
						</td>
					{else}
						<td colspan="2" class="price" id="total_price_container">
							<span id="total_price">{displayPrice price=$total_price_without_tax}</span>
						</td>
					{/if}

I happened to get exactly what I wanted, except that the Shipping cost is between the ex. tax and the inc. tax.

 

post-1015994-0-59009100-1437816659_thumb.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...