You are here:  » Different "Currencies"

Support Forum



Different "Currencies"

Submitted by ANDREWCX on Fri, 2007-08-17 13:14 in

Hi David,

another question - again using http://rewardsdb.com/product/Barnes-and-Noble.html as an example. Can you think of a way I can add dynamic text before & after the 'price' based on the merchant?

For instance - all the merchants with "MILES" but not "UK" in their name would have "miles per $1" after the price. Those with "MILES" + "UK" in their name would have "miles per £" with similar for "Points" and "Cashback"...

Thanks,

Andrew

Submitted by support on Fri, 2007-08-17 13:51

Hi Andrew,

The code for this page is going to get a bit treacly rather quickly, but it's something that should be straight forward to do. Basically, where you have (in html/prices.php):

<?php print $config_currencyHTML.$product["price"]; ?>

You would need to replace this with a more complex block of code something along these lines:

<?php
  
print $config_currencyHTML.$product["price"]." ";
  if
  (
  (
strpos($product["merchant"],"MILES")!==false)
  &&
  (
strpos($product["merchant"],"UK")!==false)
  )
  {
    print 
"miles per £";
  }
  elseif
  (
  (
strpos($product["merchant"],"MILES")!==false)
  )
  {
    print 
"miles per $1";
  }
  
// etc. etc.
?>

Fingers crossed...!
Cheers,
David.