CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • show ubercart order details on civicrm custom tab
Pages: [1]

Author Topic: show ubercart order details on civicrm custom tab  (Read 3758 times)

matt.goodwin

  • Guest
show ubercart order details on civicrm custom tab
February 03, 2009, 01:37:22 pm
I think I'm going about this all wrong and I'd like to do this the right way. So I need the assistance of an expert.  8)

I have a need to show a customer's order sales history in civicrm on a custom tab.

It should look like I am superimposing the order history ubercart page within civicrm.
http://example.com/user/123/orders

I'm using Drupal 5.7 and Civicrm 2.0.6

dharmatech

  • I post frequently
  • ***
  • Posts: 280
  • Karma: 53
    • dharmatech.org
Re: show ubercart order details on civicrm custom tab
February 03, 2009, 03:57:20 pm
The uc_civicrm module here: http://www.ubercart.org/contrib/3762 does what I think you need. It creates, among other things, a tab for a contact called "purchases" with a link to their ubercart order history.

It works for Drupal 6/CiviCRM 2.1 now but there is also a Drupal 5/2.0 version.

hope this helps
tony
http://dharmatech.org
oss@dharmatech.org
801.541.8671

matt.goodwin

  • Guest
Re: show ubercart order details on civicrm custom tab
February 04, 2009, 06:42:19 am
Thanks dharmatech.
I implemented that module but like RachelNY posted here http://www.ubercart.org/contrib/3762
I am getting the same error "Sorry, an error occurred".
I have tried the sledgehammer reset and removing secure pages from the admin pages but still having the same issue.
Any suggestions before I roll up my sleeves and dig into that module?

dharmatech

  • I post frequently
  • ***
  • Posts: 280
  • Karma: 53
    • dharmatech.org
Re: show ubercart order details on civicrm custom tab
February 04, 2009, 07:22:16 am
Quote from: ttamniwdoog on February 04, 2009, 06:42:19 am
I am getting the same error "Sorry, an error occurred".

That's the generic Dojo error message.  Helpful isn't it?   :(

Quote from: ttamniwdoog on February 04, 2009, 06:42:19 am
I have tried the sledgehammer reset and removing secure pages from the admin pages but still having the same issue.
Any suggestions before I roll up my sleeves and dig into that module?

On the CiviCRM >> Manage Groups screen, do you see a Purchasers group?  If you do, and you didn't add that group yourself, then it was added by the uc_civicrm module.

On the CiviCRM >> Find Contacts >> Advanced Search screen, if you select Activities, do you see a Purchases activity?  Same comment as above.

If you go to the Drupal user page for a customer, do you see an Orders tab?  If you do, does it take you to the list of orders for that customer?  If so, then Ubercart is correctly storing orders.

-- Walt



http://dharmatech.org
oss@dharmatech.org
801.541.8671

matt.goodwin

  • Guest
Re: show ubercart order details on civicrm custom tab
February 04, 2009, 07:24:48 am
Aha! The end user's role didn't have the "uc_store module.administer store" permissions set. Now it's working.
Thank you so much for your quick and helpful responses.
My customer is going to be so happy.
Thanks!!

dharmatech

  • I post frequently
  • ***
  • Posts: 280
  • Karma: 53
    • dharmatech.org
Re: show ubercart order details on civicrm custom tab
February 06, 2009, 02:07:04 pm
uc_civicrm-6.x-2.0-1.1 has been uploaded to the Ubercart site.  This fixes bugs with contact name appearing as blank and the Purchases activity not being recorded.
http://dharmatech.org
oss@dharmatech.org
801.541.8671

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: show ubercart order details on civicrm custom tab
July 26, 2010, 05:44:13 am
hey all,

i had this working on civi 3.1.5 and ubercart 2.x for the last couple weeks. now all of a sudden i'm getting an FK constraint violation. i had thought it was cause i tried to upgrade civi to 3.1.6, but i reverted everything and i'm still getting it. any suggestions? here's the error:

Code: [Select]
Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`vtfeedor_cIviC/civicrm_activity`, CONSTRAINT `FK_civicrm_activity_source_contact_id` FOREIGN KEY (`source_contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL), 1452

Return to home page.

Error Details:

Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_activity (source_contact_id , source_record_id , activity_type_id , subject , activity_date_time , duration , details , status_id , priority_id ) VALUES ( 8 ,  49 ,  23 , 'Purchase' ,  20100726084044 ,  0 , 'A Guide for Connecting Farms to Schools & Communities (TOTAL: $0)' ,  2 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`vtfeedor_cIviC/civicrm_activity`, CONSTRAINT `FK_civicrm_activity_source_contact_id` FOREIGN KEY (`source_contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_activity (source_contact_id , source_record_id , activity_type_id , subject , activity_date_time , duration , details , status_id , priority_id ) VALUES ( 8 ,  49 ,  23 , 'Purchase' ,  20100726084044 ,  0 , 'A Guide for Connecting Farms to Schools & Communities (TOTAL: $0)' ,  2 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`vtfeedor_cIviC/civicrm_activity`, CONSTRAINT `FK_civicrm_activity_source_contact_id` FOREIGN KEY (`source_contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_activity (source_contact_id , source_record_id , activity_type_id , subject , activity_date_time , duration , details , status_id , priority_id ) VALUES ( 8 ,  49 ,  23 , 'Purchase' ,  20100726084044 ,  0 , 'A Guide for Connecting Farms to Schools & Communities (TOTAL: $0)' ,  2 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`vtfeedor_cIviC/civicrm_activity`, CONSTRAINT `FK_civicrm_activity_source_contact_id` FOREIGN KEY (`source_contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL)]"]
)
[/code]

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: show ubercart order details on civicrm custom tab
July 26, 2010, 05:54:56 am
Seems that the source contact id the code is trying to insert is 8 and that's not valid. Most probably because contact ID #8 was deleted from your database.

Do you have a contact id 8?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: show ubercart order details on civicrm custom tab
July 27, 2010, 05:53:05 am
I looked more into the code and there seemed to be some issue with the function _uc_civicrm_add_activity_purchase. The $contact array doesn't have any keys, just the contact id. So I changed

  $cid = $contact['contact_id'];

to

  $cid = $contact;

and it's now working.

DaveNotik

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
Re: show ubercart order details on civicrm custom tab
January 06, 2011, 01:41:17 pm
Hi all.

We upgraded to Drupal 6.x and CiviCRM 3.x and got our uc_civicrm integration going again.

There used to be a Purchases tab in a CRM record, nut no longer.

Now it seems a purchase is a contribution type, found in the Contributions tab.

Is this expected and the docs (http://drupal.org/project/uc_civicrm) just haven't been updated?

Seems there are significant ramifications to store purchases suddenly being included in contribution totals, no?  What if the organization didn't want to do that?  And what about all the purchases prior to uc_civicrm integration -- they're not included in contribution totals so the numbers are not accurate, right?

Thanks for any help!

--D

http://www.woven.org

dharmatech

  • I post frequently
  • ***
  • Posts: 280
  • Karma: 53
    • dharmatech.org
Re: show ubercart order details on civicrm custom tab
January 10, 2011, 11:06:51 am
D,

We haven't done much with uc_civicrm for "chicken and egg problem" reasons. There are only a handful of people using it, because it's not super useful, so we don't spend time improving it, because only a handful of people are using it. :)

AJA is a co-maintainer for that module and he's interested in doing more. If you have any suggestions or recommendations, please post them to the uc_civicrm issue tracker.

Thanks.
http://dharmatech.org
oss@dharmatech.org
801.541.8671

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • show ubercart order details on civicrm custom tab

This forum was archived on 2017-11-26.