PHP Code:
<actinic:block php="true" >
$prodrefs = "<actinic:variable name="ProductID" />";
$connect = odbc_pconnect("ActinicCatalog9","","", SQL_CUR_USE_ODBC);
$query = "SELECT [nCostPrice] FROM [Product] WHERE [Product Reference]='".$prodrefs."'";
$result = odbc_exec($connect, $query);
while(odbc_fetch_row($result)){ $ThisCostPrice = odbc_result($result, 1); }
odbc_close_all();
$ProductCostPriceFormatted = "£".number_format($ThisCostPrice/100, 2, '.', ',');
$ProductCostPriceRaw = number_format($ThisCostPrice/100, 2, '.', '');
//uncomment as needed
//echo $ProductCostPriceRaw;
echo $ProductCostPriceFormatted;
</actinic:block>
Drop this into your template at the product level.
I made a template with it in and called it like this:
HTML Code:
<strong><actinic:variable name="CroweCostPrice" /></strong>
Comment