Hi there,
I have a site sitting on ModX Evolution 1.04 - Apache/Linux Server.
My question relates to help on how to implement a snippet that will change a TV entry due to a sales tax rate change.
I have a chunk called {{priceLink}}
Here is the code in {{priceLink}}
<div class="pricelink">
<p>[*quantity*]</p>
<p>£ [*price*] inc VAT</p>
<p><a title="[*linktitle*]" href="http://some-site.com/index.php?=blahblahblah/itemCode=[*productcode*]">Buy This</a></p>
</div>
The TV that I want to manipulate here is of course
[*price*]
I have a snippet that may need some alteration but here’s what I have anyways - the snippet is called [[taxRate]]
<?php
$output = '';
$newVat = 120;
$oldVat = 117.5;
if (!empty($input) && is_numeric($input) && !empty($options) && is_numeric($options)) {
/* Uses is_numeric function to avoid integer, float issue. Multiply & round the Float to 2 Digits */
$output = $input / $oldVat;
$output = $output * $newVat;
$output = round($output * $options, 2);
}
else
$output = $input;
return $output;
?>
In the page resource where I want my chunk to appear I naturally use {{priceLink}}
I have tried to edit the chunk see below
// code as previous
<p>£ [[*price:taxRate=`1`]] inc VAT</p>
// code as previous
</div>
Can’t get this to work, need some help someone.
Many thanks