Need help with osccommerce

Discussion in 'eCommerce' started by bm4web, Oct 1, 2011.

  1. #1
    hi,

    i am an OsCommerce programmer want to know that how to add sort by product price as drop down on product listing page?

    suggest me in this...
     
    bm4web, Oct 1, 2011 IP
  2. karilan

    karilan Greenhorn

    Messages:
    52
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #2
    send details I can help for this matter.
     
    karilan, Oct 1, 2011 IP
  3. bm4web

    bm4web Well-Known Member

    Messages:
    718
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #3
    its fixed thanks.....
     
    bm4web, Oct 1, 2011 IP
  4. Pritam Verma

    Pritam Verma Peon

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This question keeps coming up & people seem to have trouble finding the answer in the forums, so I'll put this here to make it easy.

    The product list order is by name as default, that is hard coded within index.php so you must change that to alter.

    The product list sort order also depends on what was clicked last, you may have noticed that annoying '+' by 'product name' in the list heading, thats supposed to tell you that clicking on that or 'product name' will change list order on product name, similarly clicking on any other heading will order list by that column.

    The code that sets the default order starts aroun 200 of index.php


    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_name";
    break;
     
    Pritam Verma, Oct 4, 2011 IP
  5. Pritam Verma

    Pritam Verma Peon

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Pritam Verma, Oct 4, 2011 IP