Adding an (optional) ability for users, any user who can view that field, to convert the currency on the fly.

Something like: "$340,000.00 (click here to convert)" and then a drop-down could open and ask which currency to convert to. suppling the converted amount on the same page, without a refresh needed (ajax?), would be a big big bonus.

Comments

wim leers’s picture

I've thought about this as well. It's easy to implement, except that I would need some sort of pop-up or bubble thing. If you could do the research for that, I may be able to implement this sooner.

asak’s picture

What about HoverTip ? using a clicktip could work nicely...

wim leers’s picture

Clicktips aren't obvious enough. We'd need some special "convert" marker (like for example the External Links module does. The question mark doesn't communicate the ability to convert the currency.

And this project seems more stable: http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/.

wim leers’s picture

Assigned: Unassigned » wim leers
Status: Active » Postponed

Postponing. This will be a feature of the Drupal 6 port only: AHAH forms are super easy there, while they're a complete PITA in Drupal 5.

wim leers’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Assigned: wim leers » Unassigned

Won't be implemented in the Drupal 5 version, which is now a bugfix-only branch.

markus_petrux’s picture

StatusFileSize
new595 bytes

Attached a mini calculator icon that I found at famfamfam silk icons. It could be displayed to the right of the currency symbol, and on mouse over it could display "Click here to convert".

Then, how about a jQuery UI Dialog with buttons and overlay such as the one in this demo.

The dialog could have a currency selection box and invoke Currency API to perform the conversion using Ajax.

Conversion direction would work from the current field currency to a set of enabled currencies that could be selected from widget settings for that field.

markus_petrux’s picture

Status: Postponed » Active
markus_petrux’s picture

Status: Active » Fixed

Featured added to CVS. Please, check it out. I'll pack it and release as-is if no major issue arises.

markus_petrux’s picture

Here's the README.txt of the new module:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Money CCK field Conversion Dialog for Drupal 6
;; $Id: README.txt,v 1.1.2.1 2008/11/23 18:03:03 markuspetrux Exp $
;;
;; Original author: markus_petrux  (http://drupal.org/user/39593)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

OVERVIEW
========

Provides 'Click to convert!' addon for Money CCK fields, implemented as an
additional formatter for Money CCK fields.

When enabled, a small calculator icon is displayed next to the money value when
the node is rendered. When the calculator icon is clicked, a conversion dialog
pops up allowing the user to choose the currency to convert the amount to.

The conversion dialog is based on jQuery UI Dialog widget, and can be themed to
suit the site needs. The conversion is performed using the Currency API which
is invoked on the background using Ajax when the user selects a currency.

The module allows site administrators grant access to this feature by means of
the 'use money conversion dialog' permission. When a particular user does not
have permission to use the conversion dialog, the default money formatter is
used.


REQUIREMENTS
============

- CCK (http://drupal.org/project/cck)
- Currency API (http://drupal.org/project/currency)
- Format Number API (http://drupal.org/project/format_number)
- Formatted Number CCK (http://drupal.org/project/formatted_number)
- Money CCK fields (http://drupal.org/project/money)
- jQuery UI (http://drupal.org/project/jquery_ui)


INSTALLATION
============

- Please, make sure all required modules are installed first.

- Copy all contents of this package to your modules directory preserving
  subdirectory structure.

- Goto Administer > Site building > Modules to install this module.

- Goto Administer > User management > Permissions and assign the permission
  'use money conversion dialog' to the user roles of your choice.

- Edit the content types that have Money fields, visit the tab 'Display fields'
  and choose the option 'Conversion dialog' for the Money based fields of your
  choice.
wim leers’s picture

Any chance you could provide a demo for this? Or a quick screen cast?

In any case: AWESOME work! You're pushing this module forward at blazing speeds! Handing over this module to you is the best thing I ever did for it :)

markus_petrux’s picture

StatusFileSize
new3.04 KB

Yep! :-D

Attached a screenshot of the money conversion dialog.

The dark part of the image is becasue the dialog is modal and an overlay darkens the whole HTML document. Still, you can see several money fields with the small calculator icon to the right of them. When you click on one of these icons, the dialog pops up, and you can now convert the amount to any supported currency.

It can all be themed, so the look can be adapted to any site easily. :)

And it goes without affecting the code of the Money CCK field module. It just implements an additional formatter for 'money' fields. So it can be used as an example to write custom addons. Well, I hope.

wim leers’s picture

Great! :)

A next step – but a *very* hard one – would be to implement it in such a manner that a user could convert an entire view to another currency… which would require some serious DB magic. This is something that you'll probably want to postpone because it'll definitely be hard and possibly require some hacks to CCK and/or Views.

markus_petrux’s picture

Ugh, ma! xD

This is just a little CCK field. Someone in need of such feature would have to write it's own stuff, which would be mostly related to other modules such as Currency API, Views, Computed Field, etc. :-)

wim leers’s picture

Agreed :)

In any case, *excellent* work so far! ;) :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

iqbalbaskara’s picture

Sorry, is this Money CCK field Conversion Dialog ready yet? If so, where can i download it? I think I need it and I bet It will be very useful for e-commerce websites
Great work guys!

UNarmed’s picture

Hey this is exactly what i am looking for =D Is it included in the latest version of the Money CCK module?