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

Donation total not showing up when switch levels if donation form has default donation level with $0 amount. #2488

Closed
2 tasks
emgk opened this issue Dec 8, 2017 · 4 comments
Assignees
Milestone

Comments

@emgk
Copy link
Contributor

emgk commented Dec 8, 2017

Issue Overview

Donation form with $0 amount is not showing Donation Total: above donate button in donation form in front-end. ( it can be intended behavior ) but when multi-level donation form with default level which has $0 price is introducing a bug.

Because when switching level on front-end it doesn't show Donation Total: ( if default donation level has value $0 ) but it is necessary because stripe module checkout taking donation amount from data-total attribute or maybe other add-ons too.

screenshot-givewp dev-2017-12-08-18-38-08-816

ezgif-4-3d7b2642b7

Expected Behavior

  • Donation total field should show even if donation form has $0 amount.

Current Behavior

  • Donation total field doesn't appear even when switching donation level which has amount > $0.

Possible Solution

Steps to Reproduce (for bugs)

  1. Go to add donation form page.
  2. Add donation levels more than one but keep one level with $0
  3. Save and view it on front-end.
  4. Switch donation level, you will see Donation Total: didn't appear yet.
  5. Check stripe module checkout in the backend. ( if you stripe setup )
  6. and checkout you will see there is no amount is showing in the popup. (See GIF)

Related Issues and/or PRs

Todos

  • Tests
  • Documentation

WordPress Environment

``` ### WordPress Environment ###

Home URL: http://givewp.dev
Site URL: http://givewp.dev
WP Version: 4.9.1
WP Multisite: –
WP Memory Limit: 256 MB
WP Debug Mode: ✔
WP Cron: ✔
Language: en_US
Permalink Structure: /%postname%/
Show on Front: posts
Table Prefix Length: 3
Table Prefix Status: Acceptable
Admin AJAX: Inaccessible
Registered Post Statuses: publish, future, draft, pending, private, trash, auto-draft, inherit, refunded, failed, revoked, cancelled, abandoned, processing, preapproval

Server Environment

Hosting Provider: DBH: localhost, SRV: givewp.dev
TLS Connection: Connection uses TLS 1.2
TLS Connection: Probably Okay
Server Info: nginx/1.10.1
PHP Version: 7.1.4
PHP Post Max Size: 1,000 MB
PHP Time Limit: 900
PHP Max Input Vars: 3000
PHP Max Upload Size: 1,000 MB
cURL Version: ❌ 7.38.0, OpenSSL/1.0.1t - We recommend a minimum cURL version of 7.40.
SUHOSIN Installed: –
MySQL Version: ❌ 5.5.55 - We recommend a minimum MySQL version of 5.6. See: WordPress Requirements
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
gzip: ✔
GD Graphics Library: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Give Configuration

Give Version: 1.8.17
Upgraded From: –
Test Mode: Enabled
Currency Code: USD
Currency Position: Before
Decimal Separator: .
Thousands Separator: ,
Success Page: http://givewp.dev/donation-confirmation/
Failure Page: http://givewp.dev/donation-failed/
Donation History Page: http://givewp.dev/donation-history/
Give Forms Slug: /donations/
Enabled Payment Gateways: Test Donation, Offline Donation, Stripe - Credit Card
Default Payment Gateway: Stripe - Credit Card
PayPal IPN Verification: Enabled
PayPal IPN Notifications: N/A
Admin Email Notifications: Enabled
Donor Email Access: Enabled

Session Configuration

Give Use Sessions: Enabled
Session: Disabled

Active Give Add-ons

Give - Stripe Gateway: ❌ Unlicensed – by WordImpress – 1.5

Other Active Plugins

Inactive Plugins

Give - Authorize.net Gateway: by WordImpress – 1.3.1
Give - Braintree Gateway: by WordImpress – 1.1.1
Give - Currency Switcher: by WordImpress – 1.0.0
Give - Fee Recovery: by WordImpress – 1.3.1

Theme

Name: Twenty Seventeen
Version: 1.4
Author URL: https://wordpress.org/
Child Theme: No – If you're modifying Give on a parent theme you didn't build personally, then we recommend using a child theme. See: How to Create a Child Theme

</details>
@ravinderk
Copy link
Collaborator

@emgk You can save 0 amount without editing amount of level but 1.00 is default amount for a level.

9ujqydl9ij

For testing purpose, only Admin wants to create a level of 0 amount but any payment method provide sandbox account for that then why test it with the Live account and 0 amount.

We do not force Admin with hard validation on the level amount because Admin has the responsibility to create a form with valid settings

@mathetos
Copy link
Member

mathetos commented Dec 8, 2017

I think the question here though is how did @emgk get that one level to be a ZERO amount? That shouldn't be able to happen; because obviously it creates problems in other ways. Don't we want to always enforce a minimum amount?

@raftaar1191
Copy link
Contributor

I agreed with you @mathetos. Actually, we should add 1 in place of ZERO "0" if admin try to save the value

Like @DevinWalker comment here #2425 (comment)

@DevinWalker DevinWalker added this to the 1.8.18 milestone Dec 8, 2017
@DevinWalker
Copy link
Member

Issue Review

I've reviewed the issue and it boils down to this: If on save a price level is 0 then revert it to 1.00. Note: admins should be able to set values less than a dollar like 0.23 as a value. But if it's empty then revert it.

Please watch this a video where I review the issue: https://goo.gl/oxg9Rh

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

5 participants