a "Click to convert" addon

asak - January 16, 2008 - 22:23
Project:Money CCK field
Version:6.x-1.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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.

#1

Wim Leers - January 17, 2008 - 09:15

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.

#2

asak - January 17, 2008 - 19:38

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

#3

Wim Leers - January 17, 2008 - 22:39

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/.

#4

Wim Leers - February 20, 2008 - 21:26
Assigned to:Anonymous» 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.

#5

Wim Leers - November 18, 2008 - 15:45
Version:5.x-1.x-dev» 6.x-1.x-dev
Assigned to:Wim Leers» Anonymous

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

#6

markus_petrux - November 20, 2008 - 21:06

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.

AttachmentSize
calculator.gif 595 bytes

#7

markus_petrux - November 20, 2008 - 21:07
Status:postponed» active

#8

markus_petrux - November 23, 2008 - 18:09
Status:active» fixed

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

#9

markus_petrux - November 23, 2008 - 18:15

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.

#10

Wim Leers - November 23, 2008 - 19:08

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 :)

#11

markus_petrux - November 23, 2008 - 19:24

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.

AttachmentSize
money_conversion_dialog.png 3.04 KB

#12

Wim Leers - November 24, 2008 - 01:53

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.

#13

markus_petrux - November 24, 2008 - 07:51

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. :-)

#14

Wim Leers - November 24, 2008 - 16:11

Agreed :)

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

#15

System Message - December 8, 2008 - 16:11
Status:fixed» closed

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

#16

iqbalbaskara - January 7, 2009 - 07:25

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!

 
 

Drupal is a registered trademark of Dries Buytaert.