the target of this module is not only trying to replace the default currency formatting of e-comm which provide by payment.module, but a complete feather for handling multiple currency management. i chose osCommerce as clone target.
currenct functions of this module:
- add multiple currency support to e-comm: provide a function
function ecurrency_format($from, $to, $price)for formatting the price, according to the given base currency and display currency, with foregin exchange rate applied. other module can apply this function rather thenpayment_format(). this will be useful for both single/multiple base currency case: store with only one base currency (e.g. implementation of osCommerce), or difference base currency for individual product (e.g. eBay auction system) - admin can add as many as currency format they need
- exchange rate can be handle manually or update by using currency_api.module
- update by using currency_api.module can be handle manully or by cron
coming on targets:
- a block for customer to change their currency display format on the fly, although they are anonymous user, as like as what osCommerce provided. i have try to implement this before in #72068, but this will not be function if drupal cache is on. that needs more work ;-)
- change back to base currency when check out (implementation of osCommerce). i found that it is a good idea for accounting: maintain the book clean in one currency format. this will work for single base currency store (multiple product + single currency = base currency check out) or eBay like auction system (single product + product individual currency = product base currency checkout). this will need work within other module (hack), may be after this module (the api) is totally function ;-)
Regards,
Edison
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | ecurrency_0.patch | 24.37 KB | hswong3i |
| #7 | currency_3.patch | 23.88 KB | sime |
| #6 | ecurrency.patch | 23.93 KB | hswong3i |
| #4 | ecurrency-1.2.tar.gz | 5.18 KB | hswong3i |
| #2 | ecurrency_1.zip | 5.31 KB | hswong3i |
Comments
Comment #1
hswong3i commenteddemo site:
http://edin.no-ip.com/drupal2/?q=admin/store/settings/ecurrency
Comment #2
hswong3i commentednew function:
Comment #3
hswong3i commentedComment #4
hswong3i commentednow i move the code to my sendbox:
http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/hswong3i/ecur...
for version 1.2:
ecurrency_format($from, $to, $price): Format the price according to input currency format.ecurrency_get_currencies(): Return an array of all currency objects.ecurrency_get_currencies_list(): Return an list of all currency objects.ecurrency_get_currency: Return the currency object matching a currency ID.i have test both install and configuration, with a small hack to payment.module. again, if you hope to test it out, here are the demo pages:
http://edin.no-ip.com/drupal2/
http://edin.no-ip.com/drupal2/?q=admin/store/settings/ecurrency
Comment #5
simehswong3i, as we discussed on IRC, you would like to move this code into CVS.
So what we need is a unified patch. If you need patches in other files, please include them in the patch. I think gordon will need to approve the first major patch.
Comment #6
hswong3i commentedthe patch to other module is a bit simple: as stay above, to payment.module
and here is the patch, thank you ;-)
Comment #7
simeHere's a patch that works for me.
Comment #8
hswong3i commentedi fix the patch
and test in within window and linux
by using "patch -p1 < ecurrency.patch" in dir "ecommerce"
Comment #9
havoc commentedwhat's the status on this module? Is it still under active development, or has it been "put on the back burner?"
Comment #10
sunDo not use code separators like:
Do not use ending PHP tag at the end of your files:
Learn more about Drupal coding guidelines here.
Comment #11
hswong3i commentedsorry that since i am too busy these days and so don't have time to update this.
i have already move the development to my other modules : the etax, ecurrency, etc
too upset that not much consideration (may be we don't really need such functions), therefore i stop my development right now :"(
Comment #12
simeI am still aware of this module. hswong3i has done a lot of work on this.
Comment #13
simeYou know. I'm going to commit this as a contrib to HEAD, and will sort out the issues sun mentioned
But... can I change the name "ecurrency" to "ec_currency"? This would be more in line with the naming convention we are starting to use.
Comment #14
sun@hswong3i: My intention was not to blame you. Please don't misunderstand my comment. It's just that any code for Drupal can be developed faster and better if it adheres to Drupal coding guidelines. The more it adheres, the more it can be supported by various developers.
+1 for this badly needed module (didn't tried the patch though)
Comment #15
sun+1 for naming it ec_currency
Comment #16
hswong3i commentedas a contributor, i don't care if the name need to be changed ;-)
sorry for my careless about the understanding of drupal coding style, i will learn it.
on the other hand, during my developing i notice that if i keep on develop base on the current ECOM arch, it is not easy to add the localization handling. for example, after handling the tax, i found that if we need to count tax due to location, the address handling need to be update, too. but then when i as gorden if it is possible to change the address.module, the reply is: it is base on store's table, and so...
the idea is: location handling -> taxes -> address (oops) -> store (OOPS)...
BTW since this module only handling currency foramting, i think it can be accept as alone. and for this single idea, i think it is now good enough ;-)
Comment #17
sun@hswong3i: If you're working on taxes, we might join our forces. I don't know if you're aware of this short feature overview I've created a while ago. Sorry to nag, but let us please use E-Commerce Group or IRC to exchange development issues that do not directly relate to this issue. Let's discuss just one topic in one issue.
Comment #18
simeI've commited the module to HEAD as ec_currency. To get this tagged 4.7 we need user feedback and also Gordon prefers to have a dedicated maintainer. I recommend new tickets - I'm closing this one.
Regarding tax. Yes, don't try too hard to work with current tax.module. It's stale.
Comment #19
(not verified) commented