Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Showing selected currency at checkout help!


JangoF

Recommended Posts

What I am trying to do at the moment is enforce different currencies at the checkout depending on what payment method the customer has selected. This is working just fine, but I also want to print the local currency the customer selected, but for some reason this is always printed in British Pounds (I use Dollars (default), Euros, and Pounds on my site).

 

This is what I have added to checkout_confirmation.php:

 

  //3 checks to see what currency Paypal is in, and to print local currency
 if (($HTTP_POST_VARS['payment'] = 'paypal' ) && ($currency_type = 'USD')) {
  $local_currency = 'USD';
  $order->info['total'] = 'USD';
  $currency = 'USD';
 }
 if (($HTTP_POST_VARS['payment'] = 'paypal' ) && $currency_type = 'EUR') {
  $local_currency = 'EUR';
  $order->info['total'] = 'USD';
  $currency = 'USD';
 }
 if (($HTTP_POST_VARS['payment'] = 'paypal' ) && $currency_type = 'GBP') {
  $local_currency = 'GBP';
  $order->info['total'] = 'USD';
  $currency == 'USD';
 }

 

Further down on the page I have this code to print the local currency:

 

<?php
 echo '<br><br>Total in your selected currency: ';
 echo $currencies->format($order->info['total'], $local_currency, $local_currency);
?>

 

For some reason this is always printed out as British Pounds regardless of what the customer had selected as currency.

 

Can anybody help me fix this little thing?

 

I suppose it's worth mentioning that I have "Fast Easy Checkout" installed, but this does not change anything relating to currencies.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...