Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product listing sort order


spooks

Recommended Posts

@@oxwivi

 

Your mistaken, this thread refers to code that appeared in osC2.2 in order to locate the area that requires alteration, it did not call for the code to be changed,

 

ie 2.2 has the line:

 


if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('^[1-8][ad]$', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {

 

which was unchanged by this mod.

 

but in 2.3 that line became

 if ( (!isset($HTTP_GET_VARS['sort'])) || (!preg_match('/^[1-8][ad]$/', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {

 

which should also be left un-changed, what you did was replace the new 2.3 code with old 2.2 code un-neccesarily

 

Also as the page Bruyndoncx pointed states, you cannot simply replace ereg with preg, you must use the appropriate replacement function and modify the regex.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • Replies 177
  • Created
  • Last Reply

Huh. Admittedly, I didn't read the first post all that carefully. I found that the line you mentioned fit the pattern, hence I went about replacing those. This calls for a review.

Link to comment
Share on other sites

  • 4 months later...

I have read through the thread, but can't seem to find any solution to showing products by latest added first. I have tried all the things I have seen here (and because the first post had some now obsolete code, I tried to just remove the lines removed, etc) So is there anyway to show latest added product first in the product listing? The best I could get was showing the first one added as the first item, but when I switched the page number it went back to alphabetically again.. =/ I have the latest version of osc.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...