Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom donation #110

Closed
paaljoachim opened this issue Apr 21, 2015 · 20 comments
Closed

Custom donation #110

paaljoachim opened this issue Apr 21, 2015 · 20 comments
Assignees
Milestone

Comments

@paaljoachim
Copy link

Clicking into the custom donation box it would be nice if the 0.00 went away, or atleast that one could use the delete button to remove the digits and then insert the donation amount.

Right now:
Cursor blinks behind the 0.00 amount.
Delete keyboard key does not work.
Writing for instance 50 the amount changes to 0.50.
Writing again 00 it then moves the amount forward to become 50.00.
Just a minor hassle but just removing the 0.00 giving an open space for the user to write the amount would be better.

@DevinWalker
Copy link
Member

I agree the current "currency mask" plugin we're using isn't the greatest option. There's a better way! I just haven't found a more reliable currency than: https://github.com/plentz/jquery-maskmoney

Demo: http://plentz.github.io/jquery-maskmoney/

It has to be able to support custom thousands, decimals particularly. Any suggestions?

This was referenced Apr 21, 2015
@paaljoachim
Copy link
Author

Hey Devin

As seen right above I have posted on two other jQuery Github repos. Perhaps they might fit in....

Some other sites.
http://jquery-plugins.net/labelmask-alternative-to-input-masks
http://plugins.jquery.com/tag/mask/

Have a great day!

@DevinWalker
Copy link
Member

@paaljoachim I looked over the links you provided and am still leaning towards maskMoney - There's got to be something better out there though...

@paaljoachim
Copy link
Author

As you notice I posted on their Github asking if they could make the process easier with their own code.

@ibndawood
Copy link
Contributor

👍 I faced the same difficulty. I like the http://www.gofundme.com/ approach.

@DevinWalker
Copy link
Member

@ibndawood it looks like Go Fund Me never asks for a cent value?

@ibndawood
Copy link
Contributor

@DevinWalker, This thought never occurred to me. Maybe Give can just use whole numbers. Your thoughts ?

@DevinWalker
Copy link
Member

I think some would want the ability to add decimals. I could see us provide the ability to toggle between maskMoney, the GoFund Me approach (no decimals), and off completely. Being truthful, the more I use maskMoney, the more I'm kinda thinking about keeping it around. @mathetos what are your thoughts?

@mathetos
Copy link
Member

mathetos commented Jun 5, 2015

We need to keep decimals because we're talking about implementing that checkbox to allow the donor to donate the Credit Card fee, which would often end up with cents being added. Generally, I think maskMoney is working. It basically mimics how banks enter currency. Users will have to adjust to it no matter which way we go. So far, outside of this thread, we aren't getting any negative feedback so I don't think we should "fix" a problem that so far isn't there.

@helgatheviking
Copy link
Contributor

I don't know if it helps at all, but what I use in my plugin is the accounting script to format the value after it has been entered. Then you could use html5 placeholders while it was still blank. The downside is that I am not sure the script is still under active development.

@DevinWalker
Copy link
Member

@helgatheviking that accounting script looks pretty nice. I'm going to take a closer look at it.

@artburkart
Copy link

I find the maskmoney plugin is the total opposite of intuitive, which is discouraging because Give offers everything my organization needs, except this is a showstopper. If people can't figure out the input box, they won't be willing to donate.

It would be helpful if Give allowed the user to type whatever they wanted and then displayed error messages when the value is invalid.

As a web developer, is there any way I can help? Cheers

@helgatheviking
Copy link
Contributor

@DevinWalker Let me know if you have any questions. I'm the author of the WooCommerce Name Your Price plugin and that script is what I am using to format the price input. You can see a demo here. If you type in a number, it is auto-formatted to the store's currency settings. If you type a word, it is formatted to 0, which can trigger errors (I support setting minimum prices, which you can see in the demo).

I basically run a function such as the following whenever the input is updated (assuming all parameters from plugin options and passed via wp_localize_script )

// format the price with accounting
function give_plugin_format_price( price, currency_symbol ){

    if ( typeof currency_symbol === 'undefined' )
        currency_symbol = ''; //send back money format with no currency symbol

    return accounting.formatMoney( price, {
        symbol : currency_symbol,
        decimal : give_plugin_params.currency_format_decimal_sep,
        thousand: give_plugin_params.currency_format_thousand_sep,
            precision : give_plugin_params.currency_format_num_decimals,
            format: give_plugin_params.currency_format  
    }).trim();

}

@DevinWalker
Copy link
Member

@helgatheviking that script looks perfect. Also, I really enjoy your plugin. :)

@artburkart it sounds like you really don't like the current maskMoney! Don't worry, we'll be taking care of it soon.

What do you guys think of an advanced option in the plugin's settings to allow the user their preferred currency validation script? Is this giving the user too many options? The default option would be @helgatheviking's script.

@DevinWalker DevinWalker added this to the 1.2 Release milestone Aug 24, 2015
@DevinWalker DevinWalker self-assigned this Aug 24, 2015
@helgatheviking
Copy link
Contributor

Thanks Devin! I think two formatting scripts would be too many options, but if you wanted to maintain both maybe a filter? That would be dev friendly in the case someone really, desperately, wanted to use the maskmoney script. Idk, I had it easy in that I went from having no script to adding the accounting script. :)

@paaljoachim
Copy link
Author

Yeah, Helga's accounting script looks really good! I would say stick to it. Why do you want the option to either use maskMoney or the accounting script? I am happy that a solution finally came into place..:)

@helgatheviking
Copy link
Contributor

Hey everyone, please give this branch a go.

@DevinWalker
Copy link
Member

Hey @helgatheviking I just tested it out and looks great. Can you submit a PR from that branch to our repo?

@helgatheviking
Copy link
Contributor

Against your main branch? I can do it when I get home.
On Aug 31, 2015 4:37 PM, "Devin Walker" notifications@github.com wrote:

Hey @helgatheviking https://github.com/helgatheviking I just tested it
out and looks great. Can you submit a PR from that branch to our repo?


Reply to this email directly or view it on GitHub
#110 (comment).

@DevinWalker
Copy link
Member

Yeah that would be great. Master branch is good.

@DevinWalker DevinWalker modified the milestones: 1.2 Release, 1.1.1 Aug 31, 2015
jonwaldstein pushed a commit to jonwaldstein/givewp that referenced this issue Aug 15, 2023
* refactor: Move fields blocks to form meta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants