The project I'm working on currently sells time-based "memberships" to the site. The client requires that the products be available in different currencies (3 currencies, to be exact) - a currency for each of the domain names used to access the same site .
Meaning, when a user goes to site.com, they will see the membership products in USD, but when a user goes to site.co.uk, they will see the same exact products in GBP (don't ask...).
Now, all payments are being handled through PayPal, but since it only allows to accept one currency per account, the client created three PayPal Pro accounts.
The only problem left to be resolved is how to trick ubercart into using different currencies.
The current plan of action is as follows:
- Set a session variable to a "currency type" (USD/GBP/etc.) when the user enters the site, based on the domain used.
- Fork the final uc_products table three ways, changing the sell_price for each product to the appropriate value in that particular currency.
- Make three copies of the following variables in the variable table, prefixing each one with the currency:
- uc_paypal_api_password
- uc_paypal_api_signature
- uc_paypal_api_username
- uc_paypal_wpp_currency
- uc_paypal_wps_currency
- Hack the variable_set() and variable_get() functions, creating exceptions for the above variables, and pulling currency-specific ones. (Don't worry about the usual "don't hack the core" reasons, it's too late for that, as this site has been hacked to hell and back.)
Now, in theory, this should all work just fine, but I would appreciate some input from other developers.
Are there any problems/scenarios that I'm overlooking?
Thanks!



Joined: 05/05/2008