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

longwave’s picture

Status: Active » Fixed

See 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.

danharper’s picture

Thanks :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.