Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Remove the "+" from product name+


Yuck

Recommended Posts

Like it says on the can, how can I remove the "+" from product listings?

 

Do you mean ..

 

Product name +

Product name -

 

?

Link to comment
Share on other sites

Do you mean ..

 

Product name +

Product name -

 

?

 

Well when looking at a list of products in a category the text "product name+" appears at the top of the column, that's what I want to remove the "+" from. I can't see any point for it.

Link to comment
Share on other sites

The "+" is actually a link. Click it and it turns to a "-".

 

It's to sort the products in ascending or descending order.

 

So it's not entirely useless.

;)

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

The "+" is actually a link. Click it and it turns to a "-".

 

It's to sort the products in ascending or descending order.

 

So it's not entirely useless.

;)

 

Well so it is!

Not very clear, so could that be replaced with an up and down arrow?

Link to comment
Share on other sites

If you have a couple of images in mind, I think I could dig up the right place to modify the code.

 

All I'd need would be the image names.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

If you have a couple of images in mind, I think I could dig up the right place to modify the code.

 

All I'd need would be the image names.

 

 

Sounds good, how about arrowup.gif and arrowdown.gif? :)

Cheers.

Link to comment
Share on other sites

MAKE A BACKUP OF THIS FILE BEFORE MAKING ANY EDITS!!!

 

In /catalog/includes/functions/general.php

 

Find this code:

 

////
// Return table heading with sorting capabilities
 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;
 }

In that code, replace this line:

 

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

With this code:

 

//	  $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? '+' : '-') : '') . '</a>';
//
// custom code added 16/02/08 for up and down arrow images
//
  $sort_plus = tep_image(DIR_WS_IMAGES . 'arrowup.gif', 'Sort products descendingly by Product Name');
  $sort_minus = tep_image(DIR_WS_IMAGES . 'arrowdown.gif', 'Sort products ascendingly by Product Name');
  $sort_suffix = ' ' . (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? $sort_plus : $sort_minus) : '') . '</a>';

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

  • 2 weeks later...
MAKE A BACKUP OF THIS FILE BEFORE MAKING ANY EDITS!!!

 

In /catalog/includes/functions/general.php

 

Find this code:

 

////
// Return table heading with sorting capabilities
 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;
 }

In that code, replace this line:

 

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

With this code:

 

//	  $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? '+' : '-') : '') . '</a>';
//
// custom code added 16/02/08 for up and down arrow images
//
  $sort_plus = tep_image(DIR_WS_IMAGES . 'arrowup.gif', 'Sort products descendingly by Product Name');
  $sort_minus = tep_image(DIR_WS_IMAGES . 'arrowdown.gif', 'Sort products ascendingly by Product Name');
  $sort_suffix = ' ' . (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? $sort_plus : $sort_minus) : '') . '</a>';

I tried this, the up arrow appears by default, if I click on it I thought it would change to a down arrow so I could sort in the reverse order but it doesn't.

 

Thanks

Link to comment
Share on other sites

Sometimes I post code that I think will work.

 

In this case, the code you see was copy/pasted from a "test area" I have where I tried the code (and it worked).

 

So, I haven't a clue what to say, Ma'am.

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Sometimes I post code that I think will work.

 

In this case, the code you see was copy/pasted from a "test area" I have where I tried the code (and it worked).

 

So, I haven't a clue what to say, Ma'am.

:blush:

Hi Jim

 

I want to try this too, when I have time to make an image :blush: but can the wording "Sort Assending" "Sort Decending" or such like appear after the arrow?

 

Thanks

Julie

Link to comment
Share on other sites

This did what you asked for me:

 

////
// Return table heading with sorting capabilities
 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>';
  $sort_plus = tep_image(DIR_WS_IMAGES . 'arrowup.gif', 'Sort products descendingly by Product Name');
  $sort_minus = tep_image(DIR_WS_IMAGES . 'arrowdown.gif', 'Sort products ascendingly by Product Name');
  $sort_suffix = ' ' . (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? $sort_plus : $sort_minus) : '') . ' ';
}

return $sort_suffix . $sort_prefix . $heading . '</a>';
 }

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

This did what you asked for me:

 

////
// Return table heading with sorting capabilities
 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>';
  $sort_plus = tep_image(DIR_WS_IMAGES . 'arrowup.gif', 'Sort products descendingly by Product Name');
  $sort_minus = tep_image(DIR_WS_IMAGES . 'arrowdown.gif', 'Sort products ascendingly by Product Name');
  $sort_suffix = ' ' . (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? $sort_plus : $sort_minus) : '') . ' ';
}

return $sort_suffix . $sort_prefix . $heading . '</a>';
 }

:thumbsup: Thanks Jim

 

I'll give it a go asap & report back. :)

 

Julie

Link to comment
Share on other sites

Sometimes I post code that I think will work.

 

In this case, the code you see was copy/pasted from a "test area" I have where I tried the code (and it worked).

 

So, I haven't a clue what to say, Ma'am.

:blush:

 

Thanks for trying anyway!

Link to comment
Share on other sites

  • 1 month later...

Thanks everyone, I have found this thread really helpful.

 

I found that you can change this

 

$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 it still keep the search funtionality but gets rid of the ugly looking + & - signs

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Does anyone know how to remove a "+" from the category name located in the "categories" info box? I originally thought that was what this topic was about, but it seems this refers to the product listing instead.

 

In the "categories" info box contained in the side column, the categories of my products are displayed with a "+" sign in front of it. This looks quite unprofessional, and could confuse customers by appearing to be able to expand or sort. I know this has to be a simple edit in a .php file, but I can't seem to locate it in any of the files or forums. Does anyone know how I could change the "+" to a "-" or a space? huh.gif

 

I am fairly new to web design, so forgive me if this is a simple thing to fix. The guy who worked here before me installed OSCommerce, but I have been editing it for some time.

 

Thanks in advance!

 

Ben

-The Bead Bar Gang

Link to comment
Share on other sites

  • 2 months later...

Ben,

 

I saw a similar question a while back, but can't locate it. But try reading the KB article here. Specifically about half way down the page around the below text.

Places an arrow after each parent category name.

 

$osC_CategoryTree->setParentString('', '->');

 

Additionally you can check out this contribution if want to do more customization, haven't tried it but looks straight forward.

 

As Jim says "ALWAYS BACKUP BEFORE MAKING CHANGES"

 

Hope this helps.

 

-dubz

Link to comment
Share on other sites

  • 3 months later...

My little addition to this thread:

 

$sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? ' - Click to sort Z - A' : ' - Click to sort A - Z') : '') . '</a>';

 

Tells people what to expect & how to sort alphabetically.

Link to comment
Share on other sites

  • 1 year later...

Archived

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

×
×
  • Create New...