Ubercart CiviCRM Integration

DharmaTech logo

DESCRIPTION

This module integrates the Ubercart e-commerce module with the CiviCRM constituent relationship management package. There are versions for Drupal 5/Ubercart 1.x/CiviCRM 1.9 and 2.0, and for Drupal 6/Ubercart 2.x/Civicrm 2.1 and 2.2.

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.

INSTALLATION

Download the tar file for your version of Drupal from the uc_civicrm Ubercart contribution page and untar it into the .../modules/ubercart/contrib/ directory. Then go to the Administer|Site Building|Modules page and enable Ubercart - CiviCRM Integration.

In CiviCRM 2.x, the functionality of API call civicrm_contact_add() has been reduced in that the call does not store a primary address. The following patch to CiviCRM 2.x file api/v2/Contact.php restores this function:

@@ -387,6 +387,17 @@
     require_once 'CRM/Contact/BAO/Contact.php';
     $contact = CRM_Contact_BAO_Contact::create( $params );

+    //  store primary address for the contact
+    require_once 'CRM/Core/BAO/Address.php';
+    $addr_params = array();
+    $addr_params['address'] = array();
+    $addr_params['address']['contact_id'] = $contact->id;
+    $addr_params['address']['1'] = $params;
+    $addr_params['address']['1']['location_type_id'] = 1;
+    $addr_params['address']['1']['is_primary'] = 1;
+
+    CRM_Core_BAO_Address::create( $addr_params, true );
+
     $transaction->commit( );

     if ( $contactID ) {

Without the above patch, only the contact name will be added in CiviCRM 2.x

UNIT TESTS

In uc_civicrm-6.x-2.0-1.2 there is tests/uc_civicrm.test. This is a unit test designed to be run by the Drupal SimpleTest module version 6.x-1.2. If you do any development on uc_civicrm you will find this test helpful.

RELEASE NOTES

6.x-2.0-1.2 Adds support for copying delivery phone number to the contact

Downloads



 
 

Drupal is a registered trademark of Dries Buytaert.