Change currency to CAD

solutionsphp - October 21, 2007 - 22:00
Project:PayPal Node
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:budda
Status:active
Description

I would like to change the default currency that PayPal Node uses to CAD. I have made the following modifications:

In paypalnode-admin.inc, line 28:

  $form['paypal']['paypalnode_currency'] = array(
   '#type'           => 'select',
   '#title'          => t('Currency'),
   '#default_value'  => variable_get('paypalnode_currency', PAYPALNODE_CURRENCY),
   '#options'        => array('USD'=>'USD', 'CAD'=>'CAD'),
   '#description' => t('Define the currency the merchant PayPal account accepts.'),
   );

In paypalnode.module, line 469:

/**
* Format currency.
*/
function _paypalnode_format_amount($amount, $currency) {
  $amount = number_format($amount, 2);
  switch($currency) {
    case 'USD':
      return "$ $amount";
    case 'CAD':
      return "C$ $amount";
    default:
      return check_plain($currency). " $amount";
  }
}

However, under Site Admin > Paypal Node, it still lists USD, GBP and EUR in the Currency drop down.

How can I get this to charge in CAD by default? Thanks in advance!

#1

budda - February 9, 2008 - 17:28
Assigned to:Anonymous» budda

I'll be adding Canadian support real soon as it has been sponsored by a client.

#2

digira - June 20, 2008 - 00:12

Is this available yet?

#3

kristyb2008 - September 8, 2008 - 01:24

I have been able to get CAD Currency to work properly with this module.
The steps outlined above are required. As well you need to modify simplepaypal.module (since it is a required module to use with Paypal Node).

At about line 56 you will also need to add:

case 'CAD':
return "$ $amount";

That should get it working properly. :-)

 
 

Drupal is a registered trademark of Dries Buytaert.