Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sorting problem


caitanya

Recommended Posts

Hi,

 

Since the products were sorted acc. to ABC and not as we wanted, we decided to use the field URL to make the sorting there. I deleted the URL Line from the Frontend and in the backend there are Nr. 1, 2, 3, ... Now the shop sorts nicely acc. to these URL numbers, but when there is more than 1 page there comes a problem. When clicking on the page nr. 2 (up right) is starts sorting again acc. to ABC and on the second page again books from the first page appear.

 

I would like to remove this sorting in the "split_page_results.php". Somehow or other I can not find the sorting there?

 

I hope you know what I mean.

 

Thank you for the help

Caitanya

Link to comment
Share on other sites

The split page class does not build the query - it just chops it up and applies LIMITs to the rows returned. You need to find the section of code that builds the query that is used to display the products.

Ususally called something like "products_query_raw"

Link to comment
Share on other sites

How did you want them to be sorted?

Would have probably been easier to just go into index.php and change

$listing_sql .= " order by pd.products_name"; to whatever it is you wanted them to be grouped by ie: price, manufacturer

Wendy James

 

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.

Link to comment
Share on other sites

  • 2 weeks later...

Great

 

thanks for help. I wanted the products to be sorted according to the URL... I changed it in index.php - it works for the first page, but if there are more than 20 products on the second page the sorting is back on name...

 

If there is a contribution, I will check it out.

 

Thanks again

Link to comment
Share on other sites

I have this function in index.php file:

 

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

for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {

if ($column_list[$i] == 'PRODUCT_LIST_NAME') {

$HTTP_GET_VARS['sort'] = $i+1 . 'a';

$listing_sql .= " order by pd.products_url";

break;

}

}

 

The function sorts great, but if there are more product pages it starts sorting according ABC...:

 

If I click on Result Pages it seems to have some kind of sorting inside: index.php?cPath=58_59&sort=2a&page=2

 

Where can I find this sort function?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...