Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Is there a way to auto change the users selected currency if a certain payment option is selected?


Recommended Posts

Posted

I use a Paymate as a payment option and they only allow to be paid in AUD.

 

I don't want to have to ask the customer to manually change to AUD, and I want to keep the default as USD.

 

Is there a way (preferably not too difficult) to auto change the users selected currency if a certain payment option is selected?

 

Thanks in advance :blink:

  • 1 month later...
Posted

Hi,

 

For multiple currencies, you can do this. Open your paymate.php file (should be at catalog/includes/modules/payment.paymate.php).

 

Find this code : function process_button() and make some adjustment so that it will look like

 

function process_button() {

global $order, $currencies, $currency;

 

if (MODULE_PAYMENT_PAYMATE_CURRENCY == 'Selected Currency') {

$my_currency = $currency;

} else {

$my_currency = substr(MODULE_PAYMENT_PAYMATE_CURRENCY, 5);

}

if (!in_array($my_currency, array('NZD', 'AUD', 'USD', 'GBP', 'EUR'))) {

$my_currency = 'NZD';

}

 

$process_button_string =

 

Note : you may configure this based on available currencies on your site.

$my_currency = substr(MODULE_PAYMENT_PAYMATE_CURRENCY, 5); = mine have 5 currencies

(!in_array($my_currency, array('NZD', 'AUD', 'USD', 'GBP', 'EUR'))) = all available currencies

$my_currency = 'NZD'; (in your case should be AUD)

 

And this SQL as well

 

insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Currency', 'MODULE_PAYMENT_PAYMATE_CURRENCY', 'Selected Currency', 'The currency to use for credit card transactions', '6', '6', 'tep_cfg_select_option(array(\'Selected Currency\',\'Only USD\',\'Only AUD\',\'Only NZD\'), ', now())");

 

Good luck.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...