Closed (fixed)
Project:
Ubercart 2 VAT support
Version:
6.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Mar 2011 at 18:38 UTC
Updated:
23 Mar 2011 at 14:01 UTC
This is more of a support question rather than a bug, I have a custom field which checks the difference between sell and list price then outputs the price accordingly. The problem is I am using the raw data fields so when I output it it shows the price without vat. How do use the field with the vat added on? My code is as follows
setlocale(LC_MONETARY, 'en_GB');
$sell = number_format($data->uc_products_sell_price, 2);
$list = number_format($data->uc_products_list_price, 2);
if($sell < $list)
echo '<h3 class="old">£'.$list.'</h3>'.'<h3 class="new">£'.$sell.'</h3>';
else
echo '£'.$sell;
any help in getting this field to display vat properly would be a great help
Thanks Dan
Comments
Comment #1
longwaveSee http://drupalcode.org/project/uc_vat.git/blob_plain/refs/heads/master:/R... for basic details on how to call uc_price to get prices including VAT; change revision from "themed" to "altered" to get the price as a number so you can perform the calculation. You will also need the full $node object available so uc_vat can figure out which tax rules need to be applied to your product.
Comment #2
danharper commentedThanks :)