Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2012
    Posts
    9
    Plugin Contributions
    0

    database error How to change Search results sorter order?

    in includes/modules/pages/advanced_search_result/header_php.php

    I changed the code to below, but when I search on my website, the search results are still sorted by Product ID. What can I do to make the results sorted by Product added date?

    PHP Code:
    /*------------------------------------------------------*/
    $productsort = array();
    $nsort = array('New Arrival','Item Name','Price(Low to high)','Price(High to low)','Bestselling');

    for (
    $i=1$i<6$i++) {
    $productsort[] = array('id' => sprintf('%2d'$i), 'text' =>$nsort[$i-1] );
    }
    $pagesize = array();
    $pagesize[] = array('id'=>24,'text'=>24);
    $pagesize[] = array('id'=>36,'text'=>36);
    $pagesize[] = array('id'=>48,'text'=>48);

    if(isset(
    $_GET['productsort']) && (int)$_GET['productsort'] > 0){
    switch (
    $_GET['productsort']){
    case 
    2:
    $product_sort " order by pd.products_name ";
    break;
    case 
    3:
    $product_sort " order by p.products_price";
    break;
    case 
    4:
    $product_sort " order by p.products_price DESC";
    break;
    case 
    5:
    $product_sort " order by p.products_ordered DESC";
    break;
    default:
    $product_sort " order by p.products_date_added DESC";
    }


  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: How to change Search results sorter order?

    ********************************** DUPLICATE POSTING ***************************
    Please follow forum rules and only post an issue once

    Other Posting

    http://www.zen-cart.com/showthread.p...s-sorter-order
    Zen-Venom Get Bitten

 

 

Similar Threads

  1. v138a How to change Search results sorter order?
    By prettyodd in forum Setting Up Categories, Products, Attributes
    Replies: 8
    Last Post: 18 Nov 2012, 07:48 PM
  2. Adding Dropdown Sorter to Category Listing and Search Results
    By preacherman in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 15 Oct 2008, 02:26 AM
  3. Search results - order logic
    By jeking in forum General Questions
    Replies: 1
    Last Post: 14 Apr 2008, 09:04 PM
  4. Replies: 8
    Last Post: 5 Dec 2006, 10:52 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR