5 replies [Last post]
littly_kitty's picture
Offline
Bug Finder
Joined: 01/20/2008
Juice: 155
Was this information Helpful?

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").

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Ubercart equivalent for showing order history in custom user

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.

bevinlorenzo's picture
Offline
Joined: 08/11/2008
Juice: 23
Re: Re: Ubercart equivalent for showing order history in custom

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?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Ubercart equivalent for showing order history in cus

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));
?>
PACraddock's picture
Offline
Joined: 08/21/2009
Juice: 23
Re: Re: Re: Re: Ubercart equivalent for showing order history in

Sorry to bring this back up, but I tried following this, and ended up with a strange situation:
"Fatal error: Call to undefined function uc_order_history() in […]user_profile.tpl.php on line 7"

This is the code of the file in question:

<?php
   
global $user;
   
$uid = $user->uid;
    print
'<div class="profile">';
    include_once
drupal_get_path('module', 'user') . '/user.pages.inc';
    print(
drupal_get_form('user_profile_form', $user));
    print
uc_order_history($user);
    print
'</div>';
?>

Could someone help me figure out why this error pops up?
For the record, it only appears the second time I load the page after resetting the cache.

PACraddock's picture
Offline
Joined: 08/21/2009
Juice: 23
Well, fixed. For the record,

Well, fixed.

For the record, for those to whom it didn't seem obvious, one had to add the following before the "print uc_order_history($user);":

<?php
   
include_once '[absolute path to the folder]/modules/ubercart/uc_order/uc_order.admin.inc';
?>