Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Name+


tammy507

Recommended Posts

I like the function that allows the columns to be sorted but agree that it could be done a better way rather than having the +.

Your online success is Paramount.

Link to comment
Share on other sites

The + and - signs are in includes/functions/general.php. Look for the tep_create_sort_heading function (at Line 896 in an unmodified copy.) The code looks like this:

  function tep_create_sort_heading($sortby, $colnum, $heading) {
   global $PHP_SELF;

   $sort_prefix = '';
   $sort_suffix = '';

   if ($sortby) {
     $sort_prefix = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('page', 'info', 'sort')) . 'page=1&sort=' . $colnum . ($sortby == $colnum . 'a' ? 'd' : 'a')) . '" title="' . tep_output_string(TEXT_SORT_PRODUCTS . ($sortby == $colnum . 'd' || substr($sortby, 0, 1) != $colnum ? TEXT_ASCENDINGLY : TEXT_DESCENDINGLY) . TEXT_BY . $heading) . '" class="productListing-heading">';
     $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? '+' : '-') : '') . '</a>';
   }

   return $sort_prefix . $heading . $sort_suffix;
 }

Change this line:

      $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? '+' : '-') : '') . '</a>';

to this:

      $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? '' : '') : '') . '</a>';

and no more + or -.

 

A better solution is to replace the + and - with images. I used a couple of small triangles: one pointed up and one pointed down. They are then called by replacing that line with:

      $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? tep_image(DIR_WS_IMAGES . "triangle_down.gif", "ascending") : tep_image(DIR_WS_IMAGES . "triangle_up.gif", "descending") ) : '');

You can have a copy of the images if you want. They are white because my text is white on a dark background, so they may not work for you. Of course you can make your own images in whatever shape that you want.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 1 month later...

Archived

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

×
×
  • Create New...