Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Any Way To Restrict Number Of Characters In Categories Sidebox?


thepw

Recommended Posts

Posted

Hi there, could somebody let me know the way to restrict the number of characters that are displayed in the category sidebox, as some of our categories are forcing box and looking rather poor ...

 

Currently for example on our categories is (they are candles btw)

 

Apple Pie, Vanilla & Gingerbread

 

in the categories sidebox only we would like it to be displayed as

 

Apple Pie ...

 

Is this possible, many thanks

 

Paul

Posted

catalog/includes/boxes/categories.php

 

replace:

// display category name
$categories_string .= $tree[$counter]['name'];

 

by:

// display category name
//substract amount of characters from category name
$categories_string .= substr($tree[$counter]['name'],0,4);

//add ... if category name is cut
if(strlen($tree[$counter]['name']) > 4){
$categories_string .= ' ...';
}

 

Replace 4 by the amount of characters you want to display.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...