impress-org / givewp

GiveWP - The #1 Donation Plugin for WordPress. Easily accept donations and fundraise using your WordPress website.
https://givewp.com/
GNU General Public License v3.0
344 stars 191 forks source link

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

Closed emgk closed 6 years ago

emgk commented 6 years ago

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

Current Behavior

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

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 ```
ravinderk commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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 https://github.com/WordImpress/Give/issues/2425#issuecomment-347689478

DevinWalker commented 6 years ago

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