Community Documentation

insert a "view your order history" and "view [username]s store" link

Last updated October 18, 2011. Created by Dublin Drupaller on January 20, 2006.
Edited by MGParisi, mimetic2, SLIU, bekasu. Log in to edit this page.

description

Inserts a simple "view your order history" and "View [username]s store" link in the user profile page. Requires the store.module to be enabled and setup. The store.module is part of the ecommerce.module suite of modules.

Usage

  • For use in your user profile page override
  • Using a text editor like NOTEPAD.EXE or an equivalent, copy and paste the code into your user_profile.tpl.php file
  • Tested and works with Drupal 4.5 and 4.6
  • Change the div class name or the link text to suit.

View order history link

<?php if ($GLOBALS['user']->uid == $user->uid): /* check to see if it is the owner of the profile before displaying this link */ ?>
<div class="orders">
<?php print l(t('View your order history'), "store/history/$user->uid")
</
div>
<?
php endif; /* end of snippet */ ?>

View [username]s store link

<div class="storelink">
<?php print l('view '. $user->name. 's store', 'store/'. $user->uid); ?>
</div>

Link to viewing order history in Ubercart (6.x)

http://www.ubercart.org/forum/support/4955/ubercart_equivalent_showing_o...

Page status

About this page

Drupal version
Drupal 4.5.x or older, Drupal 4.6.x, Drupal 4.7.x

Archive

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.