automatically calculate cost of the product in the user's currency?
sounds simple no? 
j/k i have heard of the currency api but i dont know if it is what i m looking for
|
UbercartOne cart to rule them all... |
|
| Donate | Affiliates | Sponsors | ||
can ubercart do this?
Submitted by marafa@drupal.org on Mon, 10/22/2007 - 13:39
automatically calculate cost of the product in the user's currency? sounds simple no? j/k i have heard of the currency api but i dont know if it is what i m looking for
I think it is. If we ever get multi-currency support in Übercart, I think that's what we'll use. You can get it from the Currency Exchange module. I'm currently working on a uc_currency module. I am NOT using the existing currency project for a couple of reasons.. First and foremost, it has no caching. This means that when you show a list of 10 products, it hits the remote provider 10 times. It's easy to have an in-memory cache, but you still hit the provider once per page, per visitor. The other thing I didn't like about the currency module is it has a bunch of extra junk, namely blocks for letting a user calculate exchange rates on your site. Between the extra overhead, the fact I'd basically have to rewrite it anyways, and then that I would have to wait until the maintainer patched and released it before I could use it.. it just seemed to make sense to roll my own. (But I can be convinced that is a bad idea - and the API part of mine could be pulled out into its own non-ubercart-related module anyways, replacing or merging with the existing currency module). What I have so far is an API that can use multiple currency providers (right now I'm using webserviceX, but I will probably also put in Yahoo Finance to start with - which is what the other module uses). Different providers have different currencies and update frequencies, so I think this makes sense. It also has caching using a database, with the TTL configurable. This means you hit the provider once per day (or however you configure it), regardless of pageviews/visitors. It also has a memory cache so it will only hit the database once per page. There's also some options for configuring display format (eg, "$5.00 USD ($4.00 CAD)" or "$4.00 CAD" etc..). I have some other things to get done that have priority, but I should have something within a week or two (but don't hold me to that). Actually, I should probably write a patch for the hook I'll need so it can at least possibly get into alpha 8. gregmac, that sounds awesome! Send me a PM w/ your hook need and I'll try to work it in for ya. Good luck with the rest of the code. For the record: http://www.ubercart.org/issue/1490/uc_currency_format_hook
|
|
Joined: 10/07/2007