This will allow multi currency modules to set the order's currency. I'll soon post here a link to a new multi currency field that uses CCK for it's currency and price logic.
Patch will probably need to grow and cover all payment methods, with a function that returns the currency code
uc_order_get_currency_code($order) {
return !empty($order->currency_code) ? !empty($order->currency_code) : variable_get('uc_paypal_wps_currency', 'USD');
}
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 607708-currency-per-order.patch | 1.42 KB | longwave |
| #7 | allow-define-currency-code-per-order-temp-fix.patch | 1.24 KB | sokrplare |
| #4 | uc_paypal.module.patch | 3.69 KB | nicolasb_cdip |
| #3 | allow-define-currency-code-per-order-3.patch | 1.24 KB | amitaibu |
| #2 | allow-define-currency-code-per-order-2.patch | 940 bytes | amitaibu |
Comments
Comment #1
amitaibuAnd here's the module as a use case:
http://drupal.org/project/uc_cck_currency
Comment #2
amitaibuOops, fix typo that sent the wrong currency code.
Comment #3
amitaibuRe-roll to include WPP as-well.
Comment #4
nicolasb_cdip commentedHello,
I'm using Paypal with uc_cck_currency module and I have managed to use your patches and provide one which allowed me to perform a successfull Paypal payment with two different currencies.
So in the file you patched there are other places where I made kind of the same modif.
Anyway here is a patch for the uc_paypal.module file.
I would be pleased to have any feedback.
Comment #5
amitaibu@nicolasb_cdip,
your patch isn't good for Ubercart core, as it deals with contrib module. The patch in #3 is still valid -- As part of uc_cck_currency overhaul I forgot to re-populte $order->currency_code, except a fix for that in the coming few days.
Comment #6
nicolasb_cdip commentedI missunderstood what you meant. So the function "uc_order_get_currency_code($order)" would return the currency code which is $order->data["uc_cck_currency"]["code"] if the user is using uc_cck_currency module isn't it ?
Where would you define such a function ?
I'd like to know why aren't there other lines where you should change "'CURRENCYCODE' => " as I did with my patch ? Is your patch actually working and allows you to perform a successfull Paypal payment with two different currencies ?
Comment #7
sokrplare commentedSince I haven't seen the fix for repopulating $order->currency_code I had to switch to reference $order->data['uc_cck_currency']['code'] to get this working on a client's site. Would be happy to know when the fix is in place so I can roll this back!
In the meantime, posting the patch to save someone time until you get a few free moments, Amitaibu. Thanks for a great module!
Comment #8
amitaibuI have committed a fix to uc_cck_currenycy -- http://drupal.org/cvs?commit=346032
So the patch in #3 is still the correct one.
Comment #9
abubin commentedi already applied path #3 but is having problem when checkout with paypal.
The currency still follows the one I set inside Currency Code in "PayPal Website Payments Standard".
I had my default currency as SGD and added field_mc_usd. Display of the prices work correctly in checkout cart but when in paypal site, it shows same currency I set in PayPal Website Payments Standard and doesn't change. Amount will be changed but currency does not.
Please help...
Comment #10
kaata commentedI have same problem
Comment #11
longwavePlease see #1097668: Multicurrency support which will implement this and help support multicurrency across all payment methods.
Comment #12
longwaveThe attached patch has been committed to 6.x and now needs porting to 7.x (including dealing with upgrades from 6.x with this column in place)
Comment #13
longwaveCommitted: http://drupalcode.org/project/ubercart.git/commit/8200601