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

feat(form): display Company field in donation form #2453

Closed
mathetos opened this issue Dec 5, 2017 · 8 comments

Comments

Projects
None yet
5 participants
@mathetos
Copy link
Member

commented Dec 5, 2017

User Story

As a donor, I want to associate my donation with my company so that it is clear that the contribution came from my organization rather than just myself.

Current Behavior

I currently cannot indicate that a donation is on behalf of my company because there is no field to do so.

Expected Behavior

I expect to see a Company field that is common across many web forms to indicate my company.

Possible Solution

Allow a user to enable company donations in the Form Display settings. Doing so will add a Company field immediately after the name fields in the donation form. The company should be saved as donor meta and appear within the Donor details screen.

Tasks

  • Get these implementation tasks approved by @ravinderk.
  • Add global Company Donations radio buttons setting with Disabled|Required|Optional options where the Default option will be Disabled
  • Add form Company Donations radio buttons setting with Disabled|Required|Optional|Global options. where the Default option will be Global
  • Include description Do you want a Company field to appear after First Name and Last Name?
  • Ensure Company field appears on the front-end form if the setting is enabled. The Company field should be a full-width field that appears below First Name and Last Name. The name fields must always be present even if a company field is displayed, too.
  • Save Company field to payment meta as _give_donation_company so it is permanently preserved.
  • Save Company field to donor meta as _give_donor_company and update the donor meta if a company was previously entered for that donor.
  • Display Company field in Donor details screen if it is populated.
  • Add company for the field on donor profile shortcode page.
  • Add feature to show company name on a receipt ( by default hide )
  • Add feature to show company name in email receipts.
  • Testing
@raftaar1191

This comment has been minimized.

Copy link
Member

commented Dec 13, 2017

Nice Suggestion @mathetos

Here I have try to create a small mock of what you are saying
Dashboard Form edit section:
image

Form with Individual field selected
image

Form with Company Fiedls selected
image

@DevinWalker

This comment has been minimized.

Copy link
Member

commented Dec 13, 2017

Interesting concepts @raftaar1191 - We still want to collect the person's name that's donating on behalf of the company. It would be difficult to shift how our data structure works to swap our name for company.

@kevinwhoffman

This comment has been minimized.

Copy link
Member

commented Dec 13, 2017

First Name/Last Name followed by a Company field is an extremely common pattern on forms across the web, and I think that's the simplest approach here.

Back-end

  • Company Field
    • No Company Field
    • Optional Company Field
    • Required Company Field

Front-end

  • If show_company === true then display company field between name and email.
  • If show_company === true && require_company === true then show and require the company field.
@kevinwhoffman

This comment has been minimized.

Copy link
Member

commented Dec 13, 2017

If the customers requesting this feature want to see donations by company rather than individual, then that is something that should be handled via reports. We should not have to alter Give's data structure to accommodate it.

In addition, having an individual to tie the donation back to is necessary for many reasons. If you receive a large donation from a company and it is pending, then you need to know who to contact. Many other reasons but you get the picture.

@DevinWalker DevinWalker removed the question label Dec 13, 2017

@DevinWalker DevinWalker added this to the 2.2 milestone Dec 13, 2017

@DevinWalker DevinWalker removed this from the 2.2 milestone Mar 6, 2018

@kevinwhoffman kevinwhoffman changed the title Consider a way to ask for Company Name instead of First/Last Name feat(form): display Company field in donation form Mar 14, 2018

@kevinwhoffman

This comment has been minimized.

Copy link
Member

commented Mar 14, 2018

@ravinderk Please see my updated task list above for implementation details, specifically whether you agree that this should be donor meta as I described. Reply here if you approve or have changes.

@raftaar1191 Once Ravinder has approved, move forward with the tasks as defined.

@ravinderk

This comment has been minimized.

Copy link
Collaborator

commented Mar 14, 2018

@kevinwhoffman List looks good to me. I have following question and suggestion.

  1. Will company field required by default? if not then I want to suggest to add flexibility to code to make it required if the customer wants by custom code.
  2. Rare case but the donor can change their company and donate with updated company profile. I will always suggest store donation form data into donation meta only. By this way, donation history will not overwrite for the donor. A donor can only have one company at a time, so when donation complete we will compare donor company if change then we can update it. By this way, donor profile always shows updated company name and donation history remain same.
@kevinwhoffman

This comment has been minimized.

Copy link
Member

commented Mar 14, 2018

Will company field be required by default? If not then I want to suggest to add flexibility to code to make it required if the customer wants by custom code.

Good question. Lets go with Disabled|Required|Optional as the radio button options so the user can decide if it's required or optional.

...the donor can change their company and donate with updated company profile. I will always suggest store donation form data into donation meta only. By this way, donation history will not overwrite for the donor.

I think you are right we should store the company as donation meta so that the company entered in the donation form is permanently recorded for that donation. But we should also record it in donor meta to associate the company with the individual so it can be displayed in the donor details screen.

To summarize, the company in donation meta never changes, but the company in donor meta gets updated based on the most recent donation in which that donor supplied a company.

I will update the tasks to reflect this approach. Thanks @ravinderk.

@raftaar1191

This comment has been minimized.

Copy link
Member

commented Mar 15, 2018

Slack Call Summary

Participants: @raftaar1191, @ravinderk
Topic: Discussion on Task List
Result: As discussion with @ravinderk over call on how the flow of the donation will be when company name fields will be added and also update the Task list for the same

raftaar1191 added a commit to raftaar1191/Give that referenced this issue Mar 16, 2018

raftaar1191 added a commit to raftaar1191/Give that referenced this issue Mar 16, 2018

ravinderk added a commit to raftaar1191/Give that referenced this issue Mar 21, 2018

refactor(donor): remove unrelated code
remove code changes from pr impress-org#2926 which is not related to issue impress-org#2453

ravinderk added a commit to raftaar1191/Give that referenced this issue Mar 21, 2018

refactor(donor): remove unrelated code
remove code changes from pr impress-org#2926 which is not related to issue impress-org#2453

ravinderk added a commit to raftaar1191/Give that referenced this issue Mar 21, 2018

refactor(donor): remove unrelated code
remove code changes from pr impress-org#2926 which is not related to issue impress-org#2453

DevinWalker added a commit that referenced this issue Mar 23, 2018

Merge pull request #2926 from raftaar1191/issues-2453
feat(donation): Add company name fields in donation form #2453

DevinWalker added a commit that referenced this issue Mar 26, 2018

Merge branch 'release/2.1' into issues/2912
* release/2.1: (67 commits)
  fix(notice): update Give icon asset url
  fix(notice): move close icon svg to new directory
  style(code): improve code formatting
  fix(cache): search of prefix instead of complete string
  fix(cache): remove extra param from wp_delete_cache
  feat(admin-tools): change company name filed name #2946
  feat(admin-tools): add company name filed value in donor meta #2946
  feat(admin-tools): add company name filed in import donation import CSV #2946
  feat(admin-email): Update email recipients description #2657
  style(code): fix typo
  refactor(emails): code for pr #2942
  feat(admin-email): add Email Recipients section to donor emails 2657
  feat(admin-tools): Add Company Column in export donation history CSV #2453
  design(admin-donation): refactor donor details UI #2453
  design(admin-setting): move company name setting submenu tab to display menu #2453
  refactor(admin-shortcode): improve fields and description for give_totals shortcode #1472
  refactor(activation-banner): code review improvements
  refactor(activation-banner): code reformat using proper formatting
  fix(activation-banner): don't show banner for the add-on which is already dismissed.
  code(style): set max-height to show only three give add-on.
  ...

# Conflicts:
#	includes/admin/tools/export/class-batch-export-payments.php
#	includes/misc-functions.php
#	templates/shortcode-receipt.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.