Forums / All Other Contributions/Addons / How to truncate details in Recently Viewed mod?

How to truncate details in Recently Viewed mod?

Locked

Views: 931

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
2 Sep 2008, 5:34 PM
#1
musicfreer avatar

musicfreer

Zen Follower

Join Date:
Jul 2008
Posts:
155
Plugin Contributions:
0

How to truncate details in Recently Viewed mod?

Hi, I have installed Recently Viewed Mode and it works perfectly. All I want now is to make the product name shorter with '....' at the end. Please advise how to truncate it. Thanks!!!

the tpl code is as follows:

<?php
/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_best_sellers.php 2982 2006-02-07 07:56:41Z birdbrain $
 */
  $content = '';
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
  $content .= '<div class="wrapper">' . "\n";
  $content .= '<table cellspacing="5" cellpadding="0">' . "\n";
  foreach ($_SESSION['recent_products'] as $recent_product) {
	$link = zen_href_link(zen_get_info_page($recent_product), 'products_id=' . $recent_product);
	$content .= '<tr><td valign=top><a href="' .  $link . '">' . zen_get_products_image($recent_product, SMALL_IMAGE_WIDTH/2, SMALL_IMAGE_HEIGHT/2) . '</a></td><td valign=top><a href="' . $link . '">' . zen_get_products_name($recent_product, $_SESSION['languages_id']) . '</a><div align=right>' . zen_get_products_display_price($recent_product) . '</div>' . '</a><BR>' . '</td>' . "\n" . 
				 '</tr>';
  }
  $content .= '</table>' . "\n";
  $content .= '</div>' . "\n";
  $content .= '</div>';
?>