Discussions

Get the current currency

Hy,

i build a teaser on home where need to check the current selected currency.
Is there a way to check this with php? Something like:

<?php
 
global $currency; if ($currency->currency == 'EUR'):
?>
// do this
<?php
 
endif;
?>

Is that possible?

Or even better, print the price field of a product, something like:

<?php
 $nid
= 45; $node = node_load($nid); $nodeView = node_view($node, 'price_field'); print drupal_render($nodeView);
?>

Any suggestions?

Posted: Jun 23, 2013

Comments