X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   How To Display Price Including and Excluding VAT (https://forum.x-cart.com/showthread.php?t=21879)

sank 05-18-2006 02:05 AM

How To Display Price Including and Excluding VAT
 
Hi All

I want my prices to show both including and excluding VAT, but don't want the calculation.

I've added this code at the end of my taxed_price.tpl file:-

Code:



{else}{include file="currency.tpl" value=$products[product].taxed_price}{$lng.lbl_including_tax|substitute:"tax":$tax.tax_display_name}
{/if}
{/if}
{/foreach}
{/if}


I works how i wanted but it shows net price, not taxed price.
Am I trying to pass the wrong Variable?
Is there a list anywhere of what variables are available in X-Cart to play with?

Any help would be very much appreciated

Thanks

Dave

balinor 05-18-2006 04:10 AM

http://forum.x-cart.com/viewtopic.php?t=17601

sank 05-18-2006 06:01 AM

I've altered the debug console to show variables.
I'm sure this will be very usefull, when i know smarty a little better.

My featured product array is as follows:-

Code:

Array (3)
0 => Array (38)
  productid => 3
  productcode => M1200400
  product => Premier Quality Tiger Drivers Glove
  provider => master
  distribution => empty
  weight => 0.00
  list_price => 0.00
  descr => Premier Quality Tiger Drivers Glove
  fulldescr => M1200400 Premier Quality Tiger Driver...
  avail => 1000
  rating => 2
  forsale => Y
  add_date => 1145551350
  image_x => 130
  image_y => 172
  views_stats => 51
  sales_stats => 0
  del_stats => 0
  shipping_freight => 0.00
  free_shipping => N
  discount_avail => Y
  min_amount => 1
  dim_x => 0
  dim_y => 0
  dim_z => 0
  low_avail_limit => 100
  free_tax => N
  product_type => N
  manufacturerid => 0
  return_time => 0
  price => 3.32
  is_variant => empty
  is_product_options => empty
  v_price => empty
  tmbn_url =>
  price_deducted_tax => empty
  taxed_price => 3.32*****************************************
  taxes => Array (1)
    VAT17_5 => Array (16)
      taxid => 1
      tax_name => VAT17_5
      formula => DST+SH
      address_type => S
      active => Y
      price_includes_tax => N
      display_including_tax => N
      display_info => empty
      regnumber => VAT 123-456-789-0000
      priority => 10
      rate_value => 17.5
      rate_type => %
      tax_display_name => VAT
      tax_value_precise => 0.581
      tax_value => 0.581
      taxed_price => 3.9***************************************


As you can see above I've got 2 variables both named taxed_price. The code I've typed is obviously referencing the first one. How do I reference the second?

I thought altering this:-
Code:

{include file="currency.tpl" value=$products[product].taxed_price}
To this :-
Code:

{include file="currency.tpl" value=$products[product].taxes.taxed_price}
would do the trick but it doesn't.

Any Ideas????

Thanks

Dave

sank 05-18-2006 07:09 AM

I've now got this displaying the correct info everywhere except the product detail itself.
It works on featured products, in my category pages and even the shopping cart, just not the products detail page, which shows the price including VAT as 0.

I really dont understand it! Someone please help!

My final taxed_price.tpl looks as follows:-

Code:

{* $Id: taxed_price.tpl,v 1.7.2.1 2005/07/27 09:50:23 max Exp $ *}
{if $taxes}
{foreach key=tax_name item=tax from=$taxes}
{if $tax.tax_value gt 0}
{if $tax.display_including_tax eq "Y"}
{if $display_info eq ""}{assign var="display_info" value=$tax.display_info}{/if}
{$lng.lbl_including_tax|substitute:"tax":$tax.tax_display_name}{if $display_info eq "V" or ($display_info eq "A" and $tax.rate_type eq "$")} {if $is_subtax ne 'Y'}<SPAN id="tax_{$tax.taxid}">{/if}{include file="currency.tpl" value=$tax.tax_value}{if $is_subtax ne 'Y'}</SPAN>{/if}{elseif $display_info eq "R"} {if $tax.rate_type eq "$"}{include file="currency.tpl" value=$tax.rate_value}{else}{$tax.rate_value}%{/if}{elseif $display_info eq "A"} {if $tax.rate_type eq "%"}{$tax.rate_value}% ({if $is_subtax ne 'Y'}<SPAN id="tax_{$tax.taxid}">{/if}{include file="currency.tpl" value=$tax.tax_value}{if $is_subtax ne 'Y'}</SPAN>{/if}){/if}{/if}


{else}{include file="currency.tpl" value=$products[product].taxes.VAT17_5.taxed_price}{$lng.lbl_including_tax|substitute:"tax":$tax.tax_display_name}
{/if}
{/if}
{/foreach}
{/if}


To see for yourself the URL is http://www.lasafety.co.uk/xcart

nikkodalbani 07-02-2006 04:47 AM

Tax - VAT 17.5%
 
Hi,
Checked your site, looks like everything is working.

I am trying to display the taxed price only, how would I go about doing that?

Zaid
www.nikkoe.com

nikkodalbani 07-05-2006 12:28 AM

Easier way to display TAX in product.
 
1. Login as admin
2. Open General settings page and activate "When a customer isn't logged in, it is presumed that he is from the default country" option. After you have activated the option all anonymous users (before they log in order enter registration information) will see prices for UK location (with taxes value).
3. Open the VAT 17.5 tax page at http://nikkoe.com/xcart/admin/taxes.php?taxid=1, tick "Display product price including tax" option and save the changes. Now you customer will see prices including tax rate.

eaglemobiles 12-11-2006 05:10 PM

Re: How To Display Price Including and Excluding VAT
 
Hi,

Its a very old post but i will be grateful if any one could reply to this vat issue i have copied all the code now the vat is showing properly on product list page but it shows 00.00 in product details page. Any help PLEASE

Thanks

pauldodman 04-02-2008 12:53 AM

Re: How To Display Price Including and Excluding VAT
 
An oldish thread, but maybe useful to some people.
If you wish to do the same thing on the product page - this is one answer.
Duplicate the taxed_price.tpl template that is shown earlier, e.g call it taxed_price_p.tpl

and in the else line, change the value to this:
value=$product.taxes

then edit the product.tpl file and call this new file, instead of the original.

Noodl3s 04-03-2013 02:00 AM

Re: How To Display Price Including and Excluding VAT
 
v4.5.2 - I am trying to display product prices as follows:

Ex VAT Price (larger font)
Vat amount
Inc VAT Price

I know this is an old thread but any assistance appreciated

Regards

pauldodman 04-04-2013 02:57 AM

Re: How To Display Price Including and Excluding VAT
 
Try using:
{currency value=$product.price},
{currency value=$product.taxed_price}


All times are GMT -8. The time now is 05:41 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.