Zen Cart Templates: Product Links in Account History

The account history page in zen cart is an important page for your customers. It allows them to log into their account and check the status of their orders, view tracking information (if you have this add on functionality installed), view their order history, etc. By default, the product names shown on the account history page are not linked. To encourage customers to leave reviews and to make it easier for them to find products that they have purchased that need reviews, you can customize the account history page of your zen cart template make the product names linked to their product info pages.

In your favorite plain text editor, open the includes/templates/your-template-override/templates/tpl_account_history_default.php file. If this file is not already in your template override directory, create an override for it by copying the includes/templates/template_default/templates/tpl_account_history_default.php to includes/templates/your-template-override/templates/tpl_account_history_default.php.

Find this code:


<td class="accountProductDisplay"><?php echo $order->products[$i]['name'];
if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {

and change it to this:


<?php
// bof: add Product Link to Order History
$products_link = '<a href="' . zen_href_link(zen_get_info_page($order->products[$i]['id']), 'cPath=' . zen_get_generated_category_path_rev(zen_get_products_category_id($order->products[$i]['id'])) . '&products_id=' . $order->products[$i]['id']) . '">' . $order->products[$i]['name'] . '</a>';
?>
<td class="accountProductDisplay"><?php echo $products_link;
// eof: add Product Link to Order History

if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {

Now customers can click through to the product info pages of products directly when they view their order history. This will make leaving product reviews easier and faster.

Leave a Reply