I am using WP All Import, and I use this code to do an exchange rate. I would like to do a discount randomly at the same time after converting it to my currency.
This is the code
function add_exchangerate($x) {
$markup = 20;
$y = $x * $markup;
return $y;
}
What can I add to it to actually make it for example every 20th time it runs this function it will do a discount of maybe 13%?
was thinking on adding a
$i = 1;
$i++
$xnum = mt_rand(1,1000)
while ($x = $xnum) {
$z = $x/1.15
return $z
}