Ubercart equivalent for showing order history in custom user profile?

Posts: 47
Joined: 01/20/2008
Bug Finder

This page contains an excellent tutorial for customizing the user profile:
http://drupal.org/node/35728

At the bottom of the page, there is a snippet for displaying the order history when using E-commerce on Drupal 4.7. Is there an Ubercart equivalent of this snippet?

Also, on a slightly related manner, when creating a custom user profile is there anyway of hiding the tab bar for just the user profile page (by tab bar, I mean that bar that has the "View", "Edit" "Order" links). Or better yet, is there a way to customize the tab bar (e.g. replace "edit" with "edit your account").

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

I'm not entirely sure, but you might try adding the results of the function uc_order_history() to your profile output:

<?php
  $output
.= uc_order_history($uid);
?>

Notice you need to pass in the user ID to that function.

Posts: 3
Joined: 08/11/2008

I couldn't get it to recognize the $uid variable. This is what I did to make this work:

<?php
    $output
.= uc_order_history(arg(1));
        print
t($output);
?>

Does anything look wrong with this?

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Yeah, I didn't say anything about where $uid should come from. In your case, it looks like you're taking it from the path. That should work fine. You don't need to run the output through t(), though. You can just as easily do:

<?php
 
print uc_order_history(arg(1));
?>