Hi,
I have installed the Product Listing which works very fine. But I want to add a link "more..." that brings to the product page.
I have changed the general.php file to this:
// ################### Products Description Hack begins ##############
//
// grabs a length from a string, but goes back to the last space if it cut into
// the middle of a string. If the string is longer than that, cut, then add '...'
// to the end of the string, if the $more == 1
function osc_trunc_string($str="",$len=150,$more=1)
{
if ($str=="") return $str;
if (is_array($str)) return $str;
$str = trim($str);
// if it's les than the size given, then return it
if (strlen($str) <= $len) return $str;
// else get that size of text
$str = substr($str,0,$len);
// backtrack to the end of a word
if ($str != "") {
// check to see if there are any spaces left
if (!substr_count($str," ")) {
if ($more) $str .= $lien;
$lien= '... <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_description['products_id']) . '"><b>' . TEXT_PRODUCT_DESCRIPTION_MORE . '</b></a>';
return $str; }
// backtrack
while(strlen($str) && ($str[strlen($str)-1] != " ")) {
$str = substr($str,0,-1);
}
$str = substr($str,0,-1);
if ($more) $str .= $lien;
$lien= '... <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_description['products_id']) . '"><b>' . TEXT_PRODUCT_DESCRIPTION_MORE . '</b></a>';
}
return $str . ' ' . $lien;
}
// ########### Products Description Hack ends #############
The text in every languages shows, the link too, but the ID product doesn't.
How can I have the ID product to show in the URL so that the link may work ?
Any idea ? :'(