Results 1 to 2 of 2

Attribute manager - sorting attributes on SELECT

This is a discussion on Attribute manager - sorting attributes on SELECT within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; Is there a way to re-sort the attributes on the Attribute Manager page? It seems that if I use the ...

      
  1. #1
    Active Member chrismole's Avatar
    Join Date
    Dec 2003
    Location
    Chicago
    Posts
    102
    Rep Power
    9


    Default Attribute manager - sorting attributes on SELECT

    Is there a way to re-sort the attributes on the Attribute Manager page? It seems that if I use the Attributes Manager to create product attributes, the INSERT statement creates the attributes in the order they're listed on the Attribute manager page (which looks like ascending by option_id).

    For example, I have an attribute named length with values 32", 34", 36", etc. In attribute manager, they are listed descending, 36, 34, 32. When I check off these attributes for a product and apply changes, they seem to be inserted into the db with 36 first, then 34, then 32. So if I sort my attributes by option_id, I get 36" listed first in the product dropdown rather than 32".

    Bascially, I am asking if there is a way to re-order the options listed in Attribute Manager so thay are ordered by option_id (the order they were created in Product Attributes)? I've tried adding "order by option_id" to all the SELECT queries in new_attributes_change.php, but no luck.

    thx,
    C

  2. #2
    Active Member chrismole's Avatar
    Join Date
    Dec 2003
    Location
    Chicago
    Posts
    102
    Rep Power
    9


    Default RE: Attribute manager - sorting attributes on SELECT

    I figured it out. The SELECT statement is in:
    admin/new_attributes_include line 58. Here's the statement:
    Code:
    $query2 = "SELECT * FROM products_options_values_to_products_options WHERE products_options_id = '$current_product_option_id' ORDER BY products_options_values_id DESC";
    simply change the "DESC" at the end of the statement to "ASC", like this:
    Code:
    $query2 = "SELECT * FROM products_options_values_to_products_options WHERE products_options_id = '$current_product_option_id' ORDER BY products_options_values_id ASC";
    A plus is it saves the attributes in the same ascending order, based on the order in which you entered them into admin Products Attributes manager. This is handy if you have numerical values in an attribrute dropdown that you want the customer to see in ascending order.

Similar Threads

  1. Attribute Manager w/ Catagories
    By CircleG in forum osCmax v2 Customization/Mods
    Replies: 3
    Last Post: 03-24-2007, 10:37 AM
  2. Product Options / Product Attributes.. pulldown sorting.?
    By Preston in forum osCommerce 2.2 Discussion
    Replies: 5
    Last Post: 11-24-2005, 07:53 PM
  3. changing default option/attribute drop down to please select
    By sirsonic in forum osCmax v2 Customization/Mods
    Replies: 0
    Last Post: 10-12-2005, 06:49 PM
  4. Deleted products showing in Attribute Manager
    By neil in forum osCMax v1.7 General Mods Discussion
    Replies: 0
    Last Post: 02-17-2004, 05:06 AM
  5. Sorting Product attributes
    By kjell in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 01-16-2004, 04:29 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
  •