It would be really nice if this module didn't assume that orders came through checkout (when Commerce natively lets admin users enter orders).
Also, keeping contributions in sync with the order would be really nice.
If the status or the amount or any other attribute of the order is updated, the Contribution is also updated.

This Feature is sponsored by Donor Depot.

Comments

davidwbarratt’s picture

StatusFileSize
new7.35 KB

The attached Patch does several things:

  1. It creates a CiviCRM Customer Profile (using "civicrm_contact" resulted in "too long" errors, so I used "civicrm" as the machine name).
  2. Checks to see if it's provided by the admin (or already referenced).
  3. If it's not referenced it will continue through the flow normally and then add the returned created (or found) contact to the reference field
  4. If the referenced Contact has an email that is different than the order, the order is updated with the referenced email.
  5. Updates to the contact record only occur if the contact was not already referenced
  6. The Order is synced with the contribution on each of the actions.

Also, this patch works nicely with #1896936: Default Rule is on the incorrect action.

Please test this patch and move to "Reviewed and Tested by the Community" if it works for you.

thanks!

davidwbarratt’s picture

Status: Active » Needs review
davidwbarratt’s picture

StatusFileSize
new8.12 KB

Forgot to add civicrm_contact_ref as a dependency. Also had to convert the line ending to UNIX line endings on the info file for the patch to save correctly.

thanks!

davidwbarratt’s picture

StatusFileSize
new8.2 KB

Attached is a patch that builds replaces the previous two.
It fixes some PHP errors that kept cropping up.

davidwbarratt’s picture

Issue summary: View changes

Fix formatting and add attribution.

xurizaemon’s picture

Category: Feature request » Task
Issue summary: View changes
StatusFileSize
new8.57 KB

Updating patch to account for changes in #1975106: Use CiviCRM API v3 for compatability with v4.3.x+. See branch for that issue on Github fork if the result isn't clear here.

muhleder’s picture

Status: Needs review » Closed (won't fix)

I think the dev branch accounts for orders created through the admin interface now.

The other changes that I can see in the patch are probably a no-go unfortunately. The order is updated with the email from the contact, whereas in the installation that we are working on we actually want the contact to be updated from the order. I'd accept a patch that adds a hook which would allow you to alter the order.

The patches seem to have a bunch of white space/line break changes as well which make it really hard to read btw.

Going to close this one as won't fix, too much going on in the patches to review at the moment.