Giter VIP home page Giter VIP logo

pmpro-donations's Introduction

=== Paid Memberships Pro - Donations ===
Contributors: strangerstudios
Tags: paid memberships pro, pmpro, membership, donate, donations, gifts, charity, charities
Requires at least: 4
Tested up to: 6.4
Stable tag: 2.0

Allow customers to set an additional donation amount with customized minimum, maxium, and suggested amounts via dropdown at checkout.

== Description ==

This plugin requires Paid Memberships Pro.

== Installation ==

1. Upload the `pmpro-donations` directory to the `/wp-content/plugins/` directory of your site.
1. Activate the plugin through the 'Plugins' menu in WordPress.
1. Edit the levels you want to add donations to and set the "Donation" settings.

== Frequently Asked Questions ==

= I found a bug in the plugin. =

Please post it in the issues section of GitHub and we'll fix it as soon as we can. Thanks for helping. https://github.com/strangerstudios/pmpro-donations/issues

== Changelog ==
= 2.0 - 2024-03-08 =
* FEATURE: Donation levels can now have a "donation confirmation message" that will be shown on the confirmation page after a user donates. #64 (@MaximilianoRicoTabo)
* ENHANCEMENT: Order donation amounts are now stored in order meta. #66 (@MaximilianoRicoTabo)
* ENHANCEMENT: Added a new panel for "Donations Settings" when editing a membership level. #65 (@MaximilianoRicoTabo)
* ENHANCEMENT: Added the `pmpro_alter_price` class to donation fields at checkout to detect when the checkout level price changes. #70 (@MaximilianoRicoTabo)
* BUG FIX/ENHANCEMENT: Improved the sanitization of some `$_REQUEST` variables. #68 (@MaximilianoRicoTabo)
* DEPRECATED: Donation amounts are no longer stored in order notes. Existing donation data in order notes will be gradually migrated to order meta as the donation data is accessed. #66 (@MaximilianoRicoTabo)

= 1.1.3 - 2023-09-06 =
* BUG FIX: Fixing issue where donations would not be charged when using the PayPal Express gateway. #63 (@dparker1005)

= 1.1.2 - 2023-08-15 =
* ENHANCEMENT: Added a new filter `pmpro_donations_invoice_bullets` to filter the bullet points that are added to the PMPro Invoice page. #55 (@MaximilianoRicoTabo, @dparker1005)
* ENHANCEMENT: Now wrapping the donation prompt text at checkout in a `<span>` tag so that it can be styled with CSS. #39 (@elementswebsolutions)
* ENHANCEMENT: Updating `<h3>` tags to `<h2>` tags for better accessibility. #50 (@ipokkel)
* ENHANCEMENT: Now preventing autocompletion of donation field at checkout. #45 (@MaximilianoRicoTabo)
* BUG FIX/ENHANCEMENT: Fixing paragraph spacing issues with custom help text by switching to using `wp_editor()`. #58 (@dparker1005, @MaximilianoRicoTabo)
* BUG FIX/ENHANCEMENT: Now always allowing users to renew a donations-only level. #60 (@dparker1005)
* BUG FIX: Added delimiters to regular expressions. Fixes issue where donation inputs may be ignored if non-numeric characters were included. #47 (@becleung)
* BUG FIX: Fixing issue where payment fields may not show if a non-zero donation dropdown option is selected. #59 (@dparker1005)
* BUG FIX: Now correctly sending the “Checkout - Paid" email template if a non-zero donation was added to a free level at checkout. #61 (@dparker1005)
* BUG FIX: No longer storing donation amounts in `$_SESSION` which was causing issues on some sites. #36 (@MaximilianoRicoTabo)
* REFACTOR: No longer pulling the checkout level from the `$_REQUEST` variable. #46 (@dparker1005)
* REFACTOR: Now using the function `get_option()` instead of `pmpro_getOption()`. #48 (@michaelbeil)


= 1.1.1 - 2020-08-12 =
* BUG FIX: Resolved issue where !!donation!! email variable would not be replaced if user did not donate.

= 1.1 - 2020-08-12 =
* FEATURE: Added !!donation!! email template variable.
* BUG FIX/ENHANCEMENT: Now only starting sessions on checkout page, which resolves warning from Site Health tool.
* BUG FIX/ENHANCEMENT: Now properly stripping slashes in donation "Help Text" setting.
* BUG FIX/ENHANCEMENT: Resolved PHP notice when loading the checkout page with 'Other' as a dropdown donation option.
* BUG FIX/ENHANCEMENT: Resolved PHP warning when loading a level's donation settings for the first time.

= 1.0 - 2020-04-09 =
* FEATURE: Added "Donations-Only Level" option.
* BUG FIX: Fixed bug where donation was not being added to order notes.
* BUG FIX: Now correctly hiding 'Other' option in donation dropdown menu if 'Other' is not allowed.
* BUG FIX: Fixed regular expression in pmprodon_getPriceComponents().
* BUG FIX/ENHANCEMENT: Fixed some strings that were using the wrong text domain and added translation files.
* REFACTOR: Organized code into separate files.

= .5 =
* BUG FIX: Making sure session is started before interacting with session vars.
* BUG FIX: Keeping billing address fields visible when switching to pay by check option.
* BUG FIX: No longer allowing negative donations if a minimum value wasn't set.
* ENHANCEMENT/FIX: Wouldn't always substitute text properly when translated
* ENHANCEMENT/FIX: PHP Warnings during checkout
* ENHANCEMENT: Improved fields display on membership checkout page to use no tables for compatibility with Paid Memberships Pro v1.9.4.

= .4 =
* ENHANCEMENT: Layout improvements to donations field on membership checkout.
* ENHANCEMENT: Updating links to add on documentation and plugin author to PMPro.

= .3.2 =
* ENHANCEMENT: Wrapped all text to allow translation.

= .3.1 =
* BUG: Fixed bug where donation dropdown amount was not set correctly when returning from PayPal to review. (Thanks, lok1728 on GitHub)
* BUG: Fixed bug where donation amount was not being passed correctly to PayPal.

= .3 =
* Added support for PayPal express by saving donation amount into a session variable.

= .2.2 =
* Fixed pricing conflict with PMPro Variable Pricing addon.

= .2.1 =
* Removed extra </strong> from the order bullets.

= .2 =
* Fixed the plugin URI
* Added the pmpro_donations_get_price_components filter to adjust components (e.g. if you are saving your own itemized prices)

= .1 =
* This is the initial version of the plugin.

pmpro-donations's People

Contributors

andrewlimaza avatar becleung avatar dparker1005 avatar eighty20results avatar elementswebsolutions avatar github-actions[bot] avatar greathmaster avatar ideadude avatar ipokkel avatar kimcoleman avatar maximilianoricotabo avatar messica avatar michaelbeil avatar sjolshagen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pmpro-donations's Issues

Bug: Donations aren't being stored in orders

The donation amount is not being stored correctly in member orders. Currently the only way to determine the donation amount is to subtract the subtotal from the total.

Additional Notes:

  • Test with various payment gateways

ISSUE/BUG: Donation not added to price If user includes $ sign

If the user includes a dollar sign, e.g. '$10' rather than '10', in the donation field the donation is not added to the payment.
Using Version 1.1.1:
In /includes/checkout.php:
line 224 '$level->initial_payment = $level->initial_payment + $donation;' fails if $donation starts with a $ sign.
I added a workaround after line 217:
$donation = ltrim($donation, '$'); // remove any leading $ sign

Bug: Strip slashes from Help Text

Steps to Recreate

  • Create a new membership level with donations enabled
  • Enter content in the Help Text Field with an apostrophe
  • Save the level
  • Help text will keep the slashes on the frontend and backend

Environment

  • WordPress 5.4.1
  • PMPro 2.3.2
  • Donations Add-on 1.0

Expected Behavior

  • Slashes should be stripped on apostrophes

Donation option does not display on multiple membership checkout

If a membership with the donation option is selected along with any other paid or free membership in the same checkout action the donation option is not displayed (help text and donation field). This is likely caused by a conflict with the Multiple Memberships Per User plugin.

Max Amount

If you choose "other" you are not setting a maximum donation limit.

The text on the webpage reads donation minimum amount to maximum amount.

If you don't set a maximum amount there is still a $ symbol on the webpage.
I wrote "choose the amount to donate" in the maximum line.
However, the $ symbol was in front of the text and looked odd.
An option may be to remove $ and have individuals write in.

Donations don't carry through properly

Hi,

When a user enters an initial donation, the amount will carry over to PayPal Express. However, when returning to the confirmation page at the website, the donation box and text appears again and is not populated with the donation amount. If the donation amount is left blank, PayPal will not charge the donation amount. However, the amount is recorded and reflected on the PMPRO order and checkout emails.

Is there any way to skip the additional donation box on the confirmation page, or at least to change the text to read something like "Please confirm your donation amount?"

Thanks!

PMPRO ver. 1.8.4.5
Donation Plugin ver. .2
Wordpress ver. 4.2.3

Return from PayPal Express sets donations to 0.00

When returning from PayPal Express, the donation dropdown is disabled (which is correct) but the amount shows 0.00 even if there was a donation submitted. It appears a REQUEST is used instead of SESSION.

LINE 167
<option <?php selected($price, $_REQUEST['donation']);?> value="<?php echo esc_attr($price);?>"><?php echo pmpro_formatPrice((double)$price);?></option

Updating to the below change fixes this issue.
<option <?php selected($price, $_SESSION['donation']);?> value="<?php echo esc_attr($price);?>"><?php echo pmpro_formatPrice((double)$price);?></option>

This is for version .3

Issue: Clear donation variable if checkout page is reloaded.

If a user chooses a level and place a donation, but then cancels the purchase at the PayPal Express gateway...
When they return to the site and choose a level with not donation, the donation amount is still cached in the total and appears at PayPal checkout.

The donation session variable should clear, right?

Displays Membership Costs 0 when only used for donations

We are using a membership level just to accept donations (creates all the same flow as for a membership so works for us). However, on the invoice, it displays Membership Cost: 0. While technically true, appears odd. Would be great to be able to override the bullets function.

I unhooked it in functions.php and then adopted it to our needs but would be great to be able to override it. Thanks

Min and Max Amounts not saving

Hi there - I am unable to save min and max amounts, and if I leave them blank I get the following message during the 'checkout' process:

The highest accepted donation is £. Please enter a new amount.

I am therefore unable to use the donation functionality, as it prevents completion of the registration process unusable.

To confirm I was trying to set the values to 0 and 1000 and did not use any special characters. I also tried with 1 and 1000.

The price dropdown was set to 0,5,10,15,20,other

Thanks in advance for your help, and if you need any additional info, please let me know.
Chris

Donation Only Level

Add ability to mark a level as a "donation only" level. This level will:

  • Give existing members their current level back after checkout.
  • Give new users the donation only level.
  • Allow users to checkout without creating a user or using an existing user's email address.

Donation input field autofilled by some web browsers.

A user reported that in some cases the user's web browsers may autofill the donation input (text) field with parts of an address, e.g. zipcode, street number, etc., saved in the browser resulting in the user being charged for a donation value at checkout.

We could consider adding the HTML attribute autocomplete="off" for the text input field.

This could not be replicated during testing.

Moderators: # 500040

Email variable for "Donation Only" level emails not working. Checkout-Free and (admin) template can not populate payment variables

When you make a LEVEL donation only, and a user checks out, the Checkout-Free template is used. When a checkout is seen as "FREE," certain variables will not populate. The same for the Checkout - Free(admin) email.

Donation Amount: !!donation!!
Invoice total !!invoice-total!!

These, and possibly others, do not populate in the checkout email for a Donation Only Leve, even if you add a custom template.

Ideally, a custom template can be provided for the Donation Only email. But at least, it should not be seen as a "free" level so the needed variables are available.

Screenshot 2023-05-18 at 5 10 44 PM

URGENT-

I uploaded and activated the Donations Add on.
I set my donation and custom field under my membership but the donations options does not display on the product. Please HELP! URGENT.

In the meantime I created a form using jot form until I solve the issue but I need help as soon as possible.

Thank you in advance for your prompt response.
URL - captainsforcleanwater.org

Reminder to donate annually, monthly

A user requested that there be a notification sent out to members asking for another donation on a set timeframe. I recommended a level that expires but they do not want to expire users, just remind them on a set interval that they could donate again (the level is free).

Member level changes to donation level for donation-only level.

Describe the bug
If a user already has a membership level and donates by checking out for a donation-only level their level is changed to the donation-only level if the donation-only level is inside the same level group that only allows a user to have one membership level in that group.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Memberships > Settings > Levels, create a new level group that allows users to only select one level from this group.
  2. Add a free level and a donations-only level to this group.
  3. Check out for the free level.
  4. Check out for the donation-only level
  5. See on the membership account page that the user's level changed from the free level to the donations-only level.

Expected behavior
When a user checks out for a donation-only level their original level should not be replaced with the donation-only level.

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only Paid Memberships Pro plugin is active.
  • This bug happens with a default WordPress theme active, or Memberlite.
  • I can reproduce this bug consistently using the steps above.

WordPress Environment

``` PMPro 3.0.3 ```

Store donation amount in ordermeta

v2.5+ of Paid Memberships Pro introduces the pmpro_membership_ordermeta table. We should update this Add On to store the user's "donation amount" in the ordermeta.

We would need to check the version of PMPro and make sure that the table is available before completely migrating to this method as the only place the data is stored. We can make the update to save the data in two places (order notes and ordermeta) for perhaps 1 year then update to only store in ordermeta.

This would also resolve issue #25

Bug: Undefined index: donation_dropdown in pmpro-donations.php on line 182

When price dropdown values is set the checkout page the following error is returned in the debug log `[30-Aug-2019 18:22:06 UTC] PHP Notice: Undefined index: donation_dropdown in /var/sites/public_html/wp/wp-content/plugins/pmpro-donations/pmpro-donations.php on line 182′

Temporary workaround is to check whether donation_dropdown is set.

<?php if(!empty($pmprodon_allow_other) && isset($_REQUEST['donation_dropdown']) && $_REQUEST['donation_dropdown'] != 'other') { ?>

Include Donation amount field when adding user in back-end.

Although the add-on correctly includes donation amounts when using a payment gateway, if processing payments offline, the admin using either "+Add New Order" or "Add member", there is no field to add the donation amount to. Would like to have this functionality added.

May be possible to include it in the Pay-by-Check add-on or include it in the Add New Order/Add Member if the pmpro-donations add-on is included.

Stripe doesn't bind to the checkout button if the level is free when coming in.

Donation-only level with $0 initial payment. Visit the checkout page. Change the donation amount to get the billing fields to show. Enter info and click submit. The form won't communicate with Stripe. The PMPro backend will not get the CC info, including expiration date and will complain about that. Now that the field is loaded with a value, the checkout will work. Also works if a non-zero ?donation param is passed into the URL.

Have a Donation specific confirmation email and page

Is your feature request related to a problem? Please describe.
A customer is trying to use PMPro and Donations together to keep things together and not have to use a separate donation plugin but a lot of the 'donation' workflow is still membership specific such as the confirmation page stating that the 'membership' is active.

Describe the solution you'd like
Ideally we can think out an alternative solution that either references 'donation' instead of membership on the confirmation and emails or separate templates for them.

Describe alternatives you've considered
A custom code solution is possible in the interim

BUG: Donation amounts are not being charged by PayPal express.

When a customer checks out with a donation, the actual amount charged by PayPal does not include the donation. All other indications, including the price seen on the checkout page, at PayPal checkout, and the confirmation page show the donation amount included.

Steps to re-create:

  1. under the Payment Settings & SSL tab set the Confirmation Step to "Skip the extra confirmation after users return from PayPal Express"

  2. set up a level with donations. Say $100 initial payment.

  3. at checkout choose a donation of $25

  4. checkout through PayPal

  5. after completing checkout, login to the merchant's or customer's PayPal account and check the transaction amount. Instead of being $125 it will only show that $100 was received by the merchant or charged to the customer. All other indications will show $125.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.