excerpt from : http://www.ubercart.org/forum/support/17823/hide_click_here_view_your_order_history_link_if_user_has_no_order_history
Here's a quick & dirty patch to hide the "Click here to view your order history" section of the user page if the user has no order history to view. It leaves the Orders tab alone, so the (empty) order history is still accessible; only the misleading link is removed.
in version 1.12.2.40 of uc_order/uc_order.module, change
function uc_order_user($op, &$edit, &$account, $category = NULL) {
global $user;
switch ($op) {
case 'view':
if ($user->uid && (($user->uid == $account->uid && user_access('view own orders')) || user_access('view all orders'))) {
$account->content['orders'] = array(
'#type' => 'user_profile_category',
'#weight' => -5,
'#title' => t('Orders'),
'link' => array(
'#type' => 'user_profile_item',
'#value' => l(t('Click here to view your order history.'), 'user/'. $account->uid .'/orders'),
),
);
} break;
}
}?>function uc_order_user($op, &$edit, &$account, $category = NULL) {
global $user;
switch ($op) {
case 'view':
if ($user->uid && (($user->uid == $account->uid && user_access('view own orders')) || user_access('view all orders'))) {
$result = db_fetch_object(db_query("SELECT o.order_id FROM {uc_orders} AS o WHERE o.uid = %d AND o.order_status IN ". uc_order_status_list('general', TRUE), $user->uid));
if (!$result) return;
$account->content['orders'] = array(
'#type' => 'user_profile_category',
'#weight' => -5,
'#title' => t('Orders'),
'link' => array(
'#type' => 'user_profile_item',
'#value' => l(t('Click here to view your order history.'), 'user/'. $account->uid .'/orders'),
),
);
} break;
}
}?>Hope this helps someone besides myself!
Views: Using explosed filter to make a search form.
source: http://drupal.org/node/545592