Results 1 to 10 of 10
  1. #1
    Join Date
    Sep 2009
    Posts
    14
    Plugin Contributions
    0

    Default Changing sort order of products in attributes controller

    Greetings,

    I've been adding new products and assigning them attributes. As the number of products in a category increase, it is getting increasingly hard to find them in the list. They are listed by product name. How can I change the sort to item ID#? That way the last ones (or first w/ a reverse sort) are always the ones I need to edit.

    Thanks much,

    --Allen

  2. #2
    Join Date
    Jun 2010
    Posts
    27
    Plugin Contributions
    0

    Default Re: Changing sort order of products in attributes controller

    I was wondering if you got any reply to this issue? I am wanting to sort my items by item number in the attributes controller as well.

  3. #3
    Join Date
    Sep 2009
    Posts
    14
    Plugin Contributions
    0

    Default Re: Changing sort order of products in attributes controller

    amirshawn80,

    Nope. I never did. I guess no one knows the answer to that problem.

    --Allen

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Changing sort order of products in attributes controller

    /youradmin/attributes_controller.php has this around line 43
    PHP Code:
      if ($action == 'new_cat') {
        
    $current_category_id = (isset($_GET['current_category_id']) ? $_GET['current_category_id'] : $current_category_id);
        
    $sql =     "select ptc.*
        from " 
    TABLE_PRODUCTS_TO_CATEGORIES " ptc
        left join " 
    TABLE_PRODUCTS_DESCRIPTION " pd
        on ptc.products_id = pd.products_id
        and pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'
        where ptc.categories_id='" 
    $current_category_id "'
        order by pd.products_name"
    ;
        
    $new_product_query $db->Execute($sql);
        
    $products_filter $new_product_query->fields['products_id'];
        
    zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER'products_filter=' $products_filter '&current_category_id=' $current_category_id));
      } 
    and you could change

    order by pd.products_name";
    to
    order by pd.products_id";

    The same sql in different versions is repeated a couple more times, and you would want to change all of them the same.

    Note that this is a non-overridable file, so keep a backup copy in a safe place (somewhere else). I haven't tested this, so it would be good to hear feedback on the idea.

  5. #5
    Join Date
    Jun 2010
    Posts
    27
    Plugin Contributions
    0

    Default Re: Changing sort order of products in attributes controller

    That didn't seem to work for me. I am trying to get the products in the attributes controller to be sorted by the product model number, that way it is easy to find them.

    When I made those changes it didn't affect the sort order. I'm not exactly sure what that actually changed. I was wondering if it is using a default sort order, maybe... I'm pretty lost.

    Any help is much appreciated!

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Changing sort order of products in attributes controller

    I didn't study the file at great length, so that may not have been the area related to the products you want. It is the file that should apply, though. I have to get some sleep now, but you could examine the file to see if there is any other code that looks relevant.

    That sql would definitely set the sort order of whatever it was fetching from the db. You previously mentioned wanting to see the latest products, which would be the product id, not the model, to sort on. (If the model numbers are sequential, then they do the same thing as the product id and you can again sort by id for good results.)

    Hmm, I guess it was way10c who specifically wanted the latest products...

  7. #7
    Join Date
    Jun 2010
    Posts
    27
    Plugin Contributions
    0

    Default Re: Changing sort order of products in attributes controller

    I am trying to sort it by the item model number. This would make products a lot easier for us to find. We are putting up one of a kind pieces, and there's going to be thousands of them. Trying to add the attributes is becoming impossible because the items are in random spots. I will try to mess around with that code some more. If you have any more ideas as to what could fix this let me know. I will post if I figure this out myself.

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Changing sort order of products in attributes controller

    You can order the products by model number in the sql, as long as you are querying the right tables. I would have to get into them to see exactly what is where. That is a very long file, with multiple branches of function, so it will take some sleuthing. I would suggest looking at view source on the Attributes Controller page to see any classes or tags for the section of interest, then searching for those in the file.

  9. #9
    Join Date
    Jun 2010
    Posts
    27
    Plugin Contributions
    0

    Default Re: Changing sort order of products in attributes controller

    I am still having no luck. I don't know SQL coding at all, and I think this problem is just a little over my head. I think this would be a good thing to include in the admin attribute settings page. I am surprised there hasn't been many other people with this same issue.

    I think it has to do with the products_filter but I am not sure where the settings for the products_filter are located.

    Thanks for your help, I will keep checking back to see if anyone can figure this out.

  10. #10
    Join Date
    Jun 2006
    Posts
    37
    Plugin Contributions
    0

    Default Re: Changing sort order of products in attributes controller

    Some time has past. Maybe somebody found the answer and want to share it with us.
    Sort order by products_id or by date_added is what I'm looking for.

 

 

Similar Threads

  1. Option Value Sort Order - Attributes Controller Page Only
    By dranet in forum Setting Up Categories, Products, Attributes
    Replies: 12
    Last Post: 7 Mar 2017, 08:25 AM
  2. Option values in attributes controller sort order
    By Congerman in forum Setting Up Categories, Products, Attributes
    Replies: 10
    Last Post: 18 Feb 2014, 01:21 AM
  3. Replies: 25
    Last Post: 7 Apr 2011, 05:41 AM
  4. attribute controller sort order
    By orchidlake in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 20 Feb 2009, 09:37 PM
  5. [1.2.7] Changing sort order of products
    By kelvyn in forum Customization from the Admin
    Replies: 1
    Last Post: 20 May 2006, 03:38 AM

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