1

I'm using Drupal (7.38), CiviCRM (4.6.5), Ubercart (7.x-3.8) and Ubercart_CiviCRM (7.x-4.x-dev). Whenever a user (registered/anonymous) purchases a product from the site, a contribution will be added into the CivCRM contact. If the user is anonymous, the system will create a user in Drupal as well as a contact in CiviCRM, linked by the email address. I notice some of the orders have a status of 'Abandoned' in Ubercart, but under CiviCRM's contribution tab for this contact, it is listed as 'Completed'.

I have gone through the uc_civicrm module and I found the following code in uc_civicrm/uc_civicrm.module

function _uc_civicrm_map_contribution_status($order_status) {
  // NOTE: There may be a more "correct" way to do this.
  $map = array(
    "completed"        => 1,
    "payment_received" => 1,
    "pending"          => 2,
    "processing"       => 5,
    "canceled"         => 3,
    "in_checkout"      => 5,
  );

  if (array_key_exists($order_status, $map)) {
    $id = $map[$order_status];
  }
  else {
    // Oh no.
    $id = 1;
    watchdog('uc_civicrm', 'There is no status that maps to %order_status, marking as "Complete"', array('%order_status' => $order_status), WATCHDOG_WARNING);
  }

  return $id;
}

I want to synchronize Ubercart's order status with the CiviCRM contribution status. How can I do that?

1 Answer 1

1

If you want to map 'abandoned' to the 'canceled' status in CiviCRM (there is no "abandoned" status in CiviCRM) you could revise the above like so:

$map = array(
 "completed"        => 1,
 "payment_received" => 1,
 "pending"          => 2,
 "processing"       => 5,
 "canceled"         => 3,
 "abandoned"         => 3,
 "in_checkout"      => 5,
);

Then I'd recommend making a bug report/patch on the issue you filed at the project page so it gets into the module core if the maintainers agree.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.