How do you sort the New Products page?

Home Forums Web Design and Development Contribution Announcements How do you sort the New Products page?

This topic contains 0 replies, has 0 voices, and was last updated by  prototype 8 years, 8 months ago.

  • Author
    Posts
  • #29244

    prototype
    Participant

    How do you sort the New Products page?

    I want to sort it by Date (new to old) I can’t find how to do it?

    Thanks

  • #124218

    aitsglobal
    Participant

    in catalog/products_new.php

    find:

      switch ($sort_column) {
    case 'PRODUCT_LIST_MODEL':
    $listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
    case 'PRODUCT_LIST_NAME':
    $listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
    break;
    case 'PRODUCT_LIST_MANUFACTURER':
    $listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
    case 'PRODUCT_LIST_QUANTITY':
    $listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
    case 'PRODUCT_LIST_IMAGE':
    // sorting by image name makes no sense, so just ignore it
    break;
    case 'PRODUCT_LIST_WEIGHT':
    $listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
    case 'PRODUCT_LIST_PRICE':
    $listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
    }

    and replace with


    // check to see if it is one of the columns being allowed for
    /* switch ($sort_column) {
    case 'PRODUCT_LIST_MODEL':
    $listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
    case 'PRODUCT_LIST_NAME':
    $listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
    break;
    case 'PRODUCT_LIST_MANUFACTURER':
    $listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
    case 'PRODUCT_LIST_QUANTITY':
    $listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
    case 'PRODUCT_LIST_IMAGE':
    // sorting by image name makes no sense, so just ignore it
    break;
    case 'PRODUCT_LIST_WEIGHT':
    $listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
    case 'PRODUCT_LIST_PRICE':
    $listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
    break;
    }
    */
    $listing_sql .= "ORDER BY products_date_added desc";

    basically commenting the default sorting with date added as seen in the last line.

You must be logged in to reply to this topic.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close