Use Parent (=Standard Layout using CSS v8_5_2_0)
I guess I could just put a php block in there to add the VAT...
I guess I could just put a php block in there to add the VAT...
$price = "<actinic:variable name="TaxExclusivePrice" />"; $thisprice = str_replace("£","",$price); $thisprice = trim($thisprice); if ($taxstatus == 2) { // Apply VAT $price = $thisprice; echo $price; //Prints correct price without vat $price = round($price , 2); $price = number_format($price,2); echo $price; // Prints out 0.00 $price_with_vat = $price + (17.5 *($price /100)); $price_with_vat = round($price_with_vat , 2); $price_with_vat = number_format($price_with_vat,2); echo $price_with_vat; // Prints 0.00 }
<!-- ProductPrice PHP begin --> <!-- This template uses php to access mysql products db to get price with correct tax status. --> <br/> <span class="actprice"><b>£ <!-- Connection PHP --> <actinic:block php="true" > $connection = mysql_connect ("","", "") or die ("Cannot make the connection"); $db = mysql_select_db ("",$connection) or die ("Cannot connect to database"); //CHECK TAX $thisproduct = '<actinic:variable encoding="perl" name="ProductID" selectable="false" />'; $thisproduct = trim($thisproduct); $query = sprintf("SELECT * FROM cl_products WHERE offer_id='$thisproduct' LIMIT 1"); $result = mysql_query($query); if (!$result) { $message = 'Invalid query:'; $message .= 'Whole query: ' . $query; die($message); } while ($row = mysql_fetch_assoc($result)) { $taxstatus = $row['tax']; $prodprice = $row['price']; } mysql_free_result($result); if ($taxstatus == 2) { // Apply VAT $price_with_vat = $prodprice + (17.5 *($prodprice /100)); $price_with_vat = round($price_with_vat , 2); $price_with_vat = number_format($price_with_vat,2); echo $price_with_vat; } else { echo $prodprice; } </actinic:block> <!-- Connection PHP --> </b></span><br/> <!-- ProductPrice PHP end -->
Comment