CiviCRM Integration

Contrib type: 
Module
Status: 
Deprecated
Moderation: 
Not ready for moderation

Downloads

Latest version: 
6.x-3.0-2.2-1
Compatibility: 
Ubercart 2.x

All future development and issues will be done through the Drupal uc_civicrm project page. The information presented here is for historical purposes.

This module integrates Ubercart with CiviCRM.

When a customer buys something from the Ubercart store, this module adds the name and address information they provide to the CiviCRM contact database. If the customer has a simple contact record generated by synching CiviCRM from the Drupal user table, that record is updated with the new information. If no contact record exists, one is created.

Then the new or updated contact is added to the 'Purchasers' group, which is created if necessary. An activity history record of type 'Purchase' is added to the contact's history, and the 'Purchases' tab on the contact's dashboard entry is populated with a link to the contact's order history in Ubercart.

6.x-3.0-2.2-1 Fixes a bug in 6.x-3.0-2.2 that caused failure to save the purchaser's address when a CiviCRM contact was created for the purchaser.


PreviewAttachmentSize
uc_civicrm-6.x-2.0-1.2.tar.gz8.65 KB
uc_civicrm-6.x-3.0-2.2-1.tar.gz7.86 KB
tobiaseigen's picture
Offline
Joined: 08/13/2007
Juice: 23
Re: CiviCRM Integration

this looks terrific - I will test it. thanks for contributing!

cheers,

tobias

tobiaseigen's picture
Offline
Joined: 08/13/2007
Juice: 23
tested on my site - seems to be working very well thanks!

Hello,

Thanks for a nifty contribution to ubercart. It seems to be working great on my site as advertised.

Cheers,

Tobias

dbabbage's picture
Offline
Joined: 04/19/2008
Juice: 32
Upgrade to Drupal 6.x and Ubercart 2.x

I need this module for a current site I am developing for a client. We have taken the decision to continue development with Drupal 6.4 and CiviCRM 2.1 along with Ubercart 2.x, in the expectation all will be at final release status by launch date. I have not written or ported a module before so would be nervous about trying to take on the upgrade of this module—is anyone able to assist?

dafeder's picture
Offline
Joined: 03/11/2008
Juice: 42
Re: Upgrade to Drupal 6.x and Ubercart 2.x

Any progress with 2.x version, now that beta is out?

dafeder's picture
Offline
Joined: 03/11/2008
Juice: 42
first attempt - 2.x version

Having gotten no response, here is my first attempt at a 2.x version. It has been updated to work with Ubercart 2.x, Drupal 6.x and CiviCRM 2.1. So far, working for me... feedback please!

AttachmentSize
uc_civicrm-6.x-uc2.x-1.0-beta1.tar.gz 5.78 KB
RachelNY's picture
Offline
Joined: 01/06/2009
Juice: 62
Re: first attempt - 2.x version

I installed CiviCRM today and did a sync. I logged in as administrator. I installed the module and enabled it. I went into Ubercart, did a test purchase with Paypal WPP set to use the Sandbox API server and it did not update CiviCRM.

I see no data updated from Ubercart to CiviCRM. No name, address, etc ... Do I need to take any additional steps or make any code modifications as indicated at the top of this thread?

Thank you for any help, and for taking this on...
Rachel

RachelNY's picture
Offline
Joined: 01/06/2009
Juice: 62
Re: first attempt - 2.x version

I tried installing the patch listed at the top of the page and tried it again with the same results, no name, address or product info in CiviCRM.

Quote:

the 'Purchases' tab on the contact's dashboard entry is populated with a link to the contact's order history in Ubercart.

-- I do have the "Purchases" tab, however if I click it I get "Sorry, an error occurred"

Quote:

the new or updated contact is added to the 'Purchasers' group, which is created if necessary.

-- There is no 'Purchasers' group -- only group under Manage Groups is Administrators

Quote:

An activity history record of type 'Purchase' is added to the contact's history

-- How do I check this? I don't see a civicrm_activity_history table in my db.

Please let me know how you would like me to troubleshoot/resolve.

Thanks,
Rachel

RachelNY's picture
Offline
Joined: 01/06/2009
Juice: 62
A little more info:

A little more info:

The "Purchases" tab looks like this:

<div id="purchases" dojoType="dojox.layout.ContentPane" href="/admin/store/civicrm/customer/orders/1" title="Purchases"

If I edit the HTML manually to this, the tab works, can you recode for this?

<div id="purchases" dojoType="dojox.layout.ContentPane" href="http://www.mysitename.com/admin/store/civicrm/customer/orders/1" title="Purchases"

Still no luck with the other issues, please point me in the right direction.

dharmatech's picture
Offline
Bug Finder
Joined: 01/28/2008
Juice: 94
Re: A little more info:

The dojo tabs seem to get initialized to that state somehow, inconsistently, and there is not a truly easy way to reinitialize them. I haven't figured out what causes it. The sledgehammer reset is:

  1. NULL the config_backend field in the civicrm_domain table
  2. Truncate the civicrm_cache and civicrm_menu tables
  3. Delete file .../files/civicrm/upload/Config.IDS.ini

Then bring up a page using the standard URL for your site. CiviCRM stores the menu with the URL so if you try to access it from two different URLs you will only get correct menus and tabs when you use the first URL, which was written into cache.

No doubt some of that reinitialization is unnecessary, but I don't know which part.

HTH -- Walt

RachelNY's picture
Offline
Joined: 01/06/2009
Juice: 62
Re: A little more info:

I have the Purchases tab working -- I had to disable Secure Pages for the "admin*" pages.

dafeder's picture
Offline
Joined: 03/11/2008
Juice: 42
Re: Re: first attempt - 2.x version

Hi Rachel, sorry to have taken so long to reply, I had to stop work on this project for a while and am just now starting to take it back up again. When you are looking at a contact, you should see a tab for "activities". Purchases should show up in there. This is data stored in the civicrm_activity table.

I really don't know why your people are not being added to a purchasers group, that part worked fine for me. Do you get any error messages any way along the way?

RachelNY's picture
Offline
Joined: 01/06/2009
Juice: 62
Re: Re: Re: first attempt - 2.x version

DharmaTech has taken it back up and posted a D6 version which is working great for me, only error left is that it is not copying phone number. Is yours copying phone number?

Please see the attached D6 version at the top of the page.

I don't have shippable products (now), so I had to edit the module to use billing address instead of delivery. It would be helpful for the module to copy both addresses, if difference, or just one if the other doesn't exist.

Rachel

dharmatech's picture
Offline
Bug Finder
Joined: 01/28/2008
Juice: 94
Delivery or billing address?

Does anybody have a situation where they collect a delivery address but not a billing address?

It would be easy to copy the billing information instead of the delivery information to CiviCRM, but would this result in a failure for somebody who collects delivery information but not billing information?

-- Walt

dafeder's picture
Offline
Joined: 03/11/2008
Juice: 42
Re: Re: Re: Re: first attempt - 2.x version

Yeah, this seems to be working much better than mine, which no, does not appear to copy phone number either.

-dan

dafeder's picture
Offline
Joined: 03/11/2008
Juice: 42
custom data

I realize this is more than the module's designed to do, but if anyone can recommend a way to use custom data fields in the Purchase activity, that would be great. So, far, kind of stumped on how it would be done.

Thanks

dharmatech's picture
Offline
Bug Finder
Joined: 01/28/2008
Juice: 94
6.x-2.0-1.2 supports phone number

The latest release, 6.x-2.0-1.2, copies the delivery phone number from the order to the contact record.

-- Walt

dharmatech's picture
Offline
Bug Finder
Joined: 01/28/2008
Juice: 94
Re: custom data

You can add a custom data group to the Purchases activity on the CiviCRM Custom Data page. I just tried it on 2.1.4 and it worked fine. Or did you mean something else?

-- Walt

upperholme@drupal.org's picture
Offline
Joined: 03/11/2009
Juice: 21
the patch and CiviCRM 2.2 stable

A quick one: Is the patch still required with CiviCRM 2.2 stable version?

dharmatech's picture
Offline
Bug Finder
Joined: 01/28/2008
Juice: 94
Quote:A quick one: Is the
Quote:

A quick one: Is the patch still required with CiviCRM 2.2 stable version?

Yes the patch is still required. The line numbers are a little different, the patch goes at line 375 in 2.2.0

-- Walt

grobot's picture
Offline
Joined: 04/12/2008
Juice: 289
Marvellous work

Stunning stuff Dharmatech - thanks. Have just installed this on a test server to explore it, and the contact is correctly inserted into CiviCRM with record of activity made.

Interestingly, on our test rig the contact was added with privacy settings:

Privacy: DO NOT PHONE DO NOT EMAIL DO NOT MAIL DO NOT TRADE

This is set at line 367 - 370 in uc_civicrm.module - I wonder what the use case is for this?

While I appreciate that there's no form element to obtain permission for followup contacts, it seems odd to set DO NOT TRADE on any new customer.

Thanks again!

Giant Robot - for campaign, charity, ngo & online store solutions - www.giantrobot.co.nz

dharmatech's picture
Offline
Bug Finder
Joined: 01/28/2008
Juice: 94
Quote:Interestingly, on our
Quote:

Interestingly, on our test rig the contact was added with privacy settings:

Privacy: DO NOT PHONE DO NOT EMAIL DO NOT MAIL DO NOT TRADE

This is set at line 367 - 370 in uc_civicrm.module - I wonder what the use case is for this?

Just trying to be conservative about the customer's privacy. You can change the code to something else if you want.

-- Walt

c0mputerking2's picture
Offline
Joined: 11/17/2008
Juice: 76
Re: CiviCRM Integration

Hello i have been trying to get the uc_addresses working the way i like but there are some issues with a uc_orders and uc_addresses getting addresses from different places. see here

http://drupal.org/node/396342

would this module help me this issue or just complicate things even further?

p6@drupal.org's picture
Offline
Joined: 05/25/2009
Juice: 9
Re: CiviCRM Integration
joachim's picture
Offline
Joined: 12/02/2008
Juice: 49
Re: CiviCRM Integration

About to try it and looking at the code...

Why are you doing this at the top of every function?

  if (!module_exists('civicrm')) {
    return;
  }

Civicrm is already listed as a dependency in the module info file Eye-wink

joachim's picture
Offline
Joined: 12/02/2008
Juice: 49
Re: Re: CiviCRM Integration

I get a PHP error when a logged-in user places an order (D5 version).
This is because _uc_civicrm_get_cid doesn't load in the civi API files for CRM_Core_BAO_UFMatch. Copying the require statements from the other spot in the code where CRM_Core_BAO_UFMatch is used fixes this.

nkinkade's picture
Offline
Joined: 06/11/2009
Juice: 22
Alternative address patch.

Don't know if this is of interest to anyone, but I felt like it was more reasonable to patch uc_civicrm rather than CiviCRM's core code so that address information is stored if uc_civicrm has to create a new CiviCRM user:

http://code.creativecommons.org/viewgit/drupal.git/commit/?h=cc_zupport&...

Aloha,

Nathan

Sansui's picture
Offline
Joined: 06/05/2008
Juice: 154
civicrm and ubercart - pull in existing contact's address?

I'm trying to use the civicrm integration so that I can use ubercart just as an invoicing machine. There will be no products in a store, so what I really need is when an admin goes to create an invoice, and searches for the existing contact, the civicrm contact address comes up in the ship to / bill to section of ubercart.

Does this integration provide that kind of functionality, or is this only for adding civicrm contacts that purchase a product through ubercart?

upperholme@drupal.org's picture
Offline
Joined: 03/11/2009
Juice: 21
Which versions of CiviCRM does this module support?

Judging by the issue thread at http://www.ubercart.org/issue/11131/doesnt_work_223 it appears that this module is broken. Certainly it does nothing with my 2.2.7 install on D6.13, with the above patch applied.

Would it be possible to get some clarity on the current state of play? Will this module support CiviCRM 2.2.7/8 ? If so, what patch/es if any need to be applied?

jugney's picture
Offline
Joined: 06/03/2008
Juice: 202
Re: CiviCRM Integration

Are there plans to make a version that works with CiviCRM 3.0?

upperholme@drupal.org's picture
Offline
Joined: 03/11/2009
Juice: 21
Re: Re: CiviCRM Integration

or even with 2.2.8/9?

adshill's picture
Offline
Joined: 07/24/2008
Juice: 30
CiviCRM 3.x integration

I have started a topic to potentially make this happen over on the CiviCRM forum - if anyone can contribute or even wants to show support, maybe we can do it there?

http://forum.civicrm.org/index.php/topic,10333.msg44312.html#msg44312

Here's hoping! Smiling

Adam

adshill's picture
Offline
Joined: 07/24/2008
Juice: 30
Module upgrade

My company Consult and Design International will be sponsoring the upgrade of the module by Dharmatech to version 3.x CiviCRM. More details will be posted in the next week or two.

triebwad's picture
Offline
Joined: 11/09/2009
Juice: 2
Testing help

Great news. I can help with any testing or review you need. Ping my inbox.

Piyush@drupal.org's picture
Offline
Joined: 04/07/2009
Juice: 9
CiviCRM 3.x - does not save address data

Hi,

Just tried the uc_civicrm-6.x-3.0-2.2.tar.gz with the latest CiviCRM 3.1beta.

The email, firstname and lastname fields get updated into the CiviCRM contact record. However, I have tried both the civicrm_contact_add() api patch as well as the alternate address patch from comment #26 and I just cannot get the address fields to update.

Anyone else come across this?

Thanks,
Piyush

dharmatech's picture
Offline
Bug Finder
Joined: 01/28/2008
Juice: 94
Re: CiviCRM 3.x - does not save address data

Fixed in uc_civicrm-6.x-3.0-2.2-1 for CiviCRM 3.0.2. You don't need any patch, this version uses the API as it is delivered.

MacRonin's picture
Offline
Joined: 12/21/2009
Juice: 4
I had prob with addresses on civicrm 303 + uc22

I just downloaded the most recent version of this contribution uc_civicrm-6.x-3.0-2.2-1(linked above) and installed it on a Drupal 614 CiviCRM 303 (php 5.2.6 Mysql 5.0.58) UberCart 2.2 site and got the same problem. It did create an activity record on the contact record in civicrm, It did create and add the contact to the purchases group, But it did not copy over the address information.

I don't know if it matters, but I only had billing address filled in not delivery since I was testing as "payment by check"

I tried it on two diff users on my setup.

Thanks for any assistance and the module.

dharmatech's picture
Offline
Bug Finder
Joined: 01/28/2008
Juice: 94
Re: I had prob with addresses on civicrm 303 + uc22
Quote:

I don't know if it matters, but I only had billing address filled in not delivery since I was testing as "payment by check"

It does matter. The address passed to CiviCRM comes from the delivery address field on the checkout form.

MacRonin's picture
Offline
Joined: 12/21/2009
Juice: 4
Re: Re: I had prob with addresses on civicrm 303 + uc22

Thanks for the quick response, I'm not sure why my thread subscription email didn't kick off, so I'm glad I came back manually to check (just in case)

OK, so since it passes the delivery address, if my user is buying only non-deliverable products such as file downloads, donations and memberships the address info won't be copied over.

I just browsed the source and found

// TODO: add billing address as a second address

I guess after I get the basics(for the rest of the site) in place 'll have to come back and try my hand at seeing what it will take to include the billing address. And if I feel adventurous, I'll take a look at creating my first Admin page where I can modify the defaults for some hard-coded settings

  $contact['do_not_email'] = true;
  $contact['do_not_phone'] = true;
  $contact['do_not_mail'] = true;
  $contact['do_not_trade'] = true;

Thanks again.

janette's picture
Offline
Joined: 06/22/2009
Juice: 37
collect billing rather than shipping info

Many of our users purchase items as gifts so we end up collecting contact information from non-users. Is there a patch that will collect and send the billing information to civicrm for CiviCRM 2.2?

Does the 3.0 version allow the option to collect billing contact info or is it still delivery only?

wintervanilla's picture
Offline
Joined: 03/22/2010
Juice: 31
Installation Instuctions

Hi There,

I'm using Drupal 6.15, CiviCRM 3.0.3 and Ubercart 2.2. When I added uc_civicrm to the sites/all/modules/ubercart/contrib directory and enabled it via admin/build/modules, nothing happened. No group in CiviCRM, no additional tab for Purchases - none of the expected changes seem to have happened. It seems like I'm missing an installation step, but the instructions are clear and easy as pie. Tried running cron and update scipts...

thanks in advance for any tips to help me move forward,
wintervanilla

wintervanilla's picture
Offline
Joined: 03/22/2010
Juice: 31
Update

I can't remember how now, but I was able to get past this issue and am very pleased to have a happily tangoing CiviCRM and Ubercart. I think it was something simple and silly though - like not having completed any test purchases, therefore not seeing any purchasers tab. Great module, thanks!

HershelSR's picture
Offline
Joined: 05/13/2010
Juice: 9
Updated for Ubercart 6.x-2.2 and CiviCRM 3.1.5

The uc_civicrm module attached is working for Ubercart 6.x-2.2 and CiviCRM 3.1.5.

AttachmentSize
uc_civicrm.tar.gz 13.86 KB
mikesir87's picture
Offline
Joined: 06/20/2010
Juice: 6
Re: Updated for Ubercart 6.x-2.2 and CiviCRM 3.1.5

In order for me to get this to work, I had to modify the original patch to have the following:

$addr_params['contact_id'] = $contactID;

instead of

$addr_params['address']['contact_id'] = $contactID;

But, now it works flawlessly for me. I'm using CiviCRM 3.1.5 and Ubercart 2.2 in Drupal 6. Anyone else have to do something like this, or do I just have something weird going on?

HershelSR's picture
Offline
Joined: 05/13/2010
Juice: 9
Re: Re: Updated for Ubercart 6.x-2.2 and CiviCRM 3.1.5

Not sure. Mine appears to be working fine, but it's not well-tested.

tiborg's picture
Offline
Joined: 06/11/2010
Juice: 15
Re: CiviCRM Integration

I use the uc_civicrm-6.x-3.0-2.2-1.tar.gz modul with civicrm 3.0.2. (the other version is not sync the order contact address to civicrm.) Please help me, how to change this modul that send the order comment to civicrm purchase activity such as order total?

thank you

emilyfr's picture
Offline
Joined: 10/09/2008
Juice: 32
Re: Re: Updated for Ubercart 6.x-2.2 and CiviCRM 3.1.5

i too had to make the same change as mikesir87. I also had to make a bunch of other changes including:

- uc_civicrm assumes a delivery address to send into civi from the order, however, if an item is not shippable then there's no delivery address in ubercart. for my uses, i had to change instances of delivery to be billing to work properly.

- i kept getting fatal errors when trying to order more than once with the same info because uc_civicrm doesn't set $contact['contact_id'] and once it hit civi's api it was therefore trying to always add a new contact instead of updating. uc_civicrm does in fact grab the contact id with civicrm_contact_get, but that's returned as its own array so it wasn't transitioning properly. i ran a foreach on that return and then could set the $contact['contact_id'] properly.

tiborg's picture
Offline
Joined: 06/11/2010
Juice: 15
it's correctly work?

This module update the name and address information every new order or one user date updated once, in the first purcahe?
In my test system the drupal user the first purchase updated in civicrm, and the civicrm users not updated in next new purchase, but i like seen the last updated information in civicrm.

It's correclty work?

thank you

sorry my english.

nkinkade's picture
Offline
Joined: 06/11/2009
Juice: 22
Re: it's correctly work?

This isn't directly related to uc_civicrm, but I thought I'd post this here for the benefit of anyone using uc_civicrm that might be having problems with it. We used to use uc_civicrm, then we started using the script that comes with CiviCRM called ContributionProcessor.php (in the bin/ directory), which pulls data down from PayPal and/or Google Checkout manually rather than relying on IPN or notifications. One benefit of this is that for us it obviates the needs for uc_civicrm. We use it for other things but it only required a simple patch to recognize transactions from PayPal that are from Ubercart and mark them in CiviCRM with a contribution type of "Store" so that we can easily identify then and run reports, etc.... something like:

if ( preg_match('/^Order \d+ at/', $params['transaction']['source']) ) {
    // 8 is the db ID of type "Store"... careful it doesn't change
    $params['transaction']['contribution_type_id'] = '8';
}

Basically, you can use this script to only pull down transaction history from PayPal or Google Checkout, and to only create new contacts/contributions in CiviCRM for Ubercart orders. The script doesn't add the user to a "Purchasers" group, but it does enter any and all information PayPal sends, which might even include an address.

It does require setting up a period cron job to run the script. Just thought I'd throw this out there as a viable option and alternative to uc_civicrm.

ToddFur's picture
Offline
Joined: 07/13/2010
Juice: 19
Verifying support levels.

I am getting ready to attempt building CiviCRM database using Ubercart module.

I understand for the Ubercart 2.x module I will need Drupal 6.x and civicrm 3.0

My question is if the support for CiviCRM is strictly at level 3.0? I see that their latest "stable" version is at 3.1.5. Will this ubercart module work with that?

emilyfr's picture
Offline
Joined: 10/09/2008
Juice: 32
Re: CiviCRM Integration

you can use civi 3.1.5 with ubercart 2.x and the file on this thread here: http://www.ubercart.org/project/uc_civicrm#comment-53704