Results 1 to 10 of 279

Hybrid View

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

    Default Re: Flexible Attributes addon support

    I'm not seeing anything wrong with your attributes settings or admin displays, but the storefront just ignores that sort order. Very weird.

    I do note that there are missing defines in your admin homepage Customers box (BOX_TITLE_CUSTOMERS) (caused by COWOA implementation?), which is probably not related, but who knows?

    Have you done the code update? Again, that is unlikely to affect the display in the way you are seeing, but it can't hurt to fix it.

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

    Default Re: Flexible Attributes addon support

    The odd thing is, I have attributes displaying according to sort order, not id, and the display order changes when I change the sort order.
    Yep, that's how it works on my localhost version... it is so strange, like it is ignoring the sort order on the live site.
    What is different about the environment in your localhost and live server? It pretty much has to be something there...

  3. #3
    Join Date
    Jun 2010
    Posts
    207
    Plugin Contributions
    1

    Default Re: Flexible Attributes addon support

    Quote Originally Posted by gjh42 View Post
    I'm not seeing anything wrong with your attributes settings or admin displays, but the storefront just ignores that sort order. Very weird.

    I do note that there are missing defines in your admin homepage Customers box (BOX_TITLE_CUSTOMERS) (caused by COWOA implementation?), which is probably not related, but who knows?

    Have you done the code update? Again, that is unlikely to affect the display in the way you are seeing, but it can't hurt to fix it.
    Yep, I did do the code update a day or two ago.


    Quote Originally Posted by gjh42 View Post
    What is different about the environment in your localhost and live server? It pretty much has to be something there...
    The live site has had a fair number of customizations done to it over the course of the last year or so... the localhost version was a fresh install. Unfortunately, there may be a number of different things on the live site.

    Do you know of a way to track down where in the code it tells the system how to sort the attributes? Maybe there is something that was changed that causes the code to no longer pay attention to the sort order applied in the back-end?

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

    Default Re: Flexible Attributes addon support

    attributes.php sets the query sort order with this:
    PHP Code:
                if ($pr_attr->fields['total'] > 0) {
                  if (
    PRODUCTS_OPTIONS_SORT_ORDER=='0') {
                    
    $options_order_by' order by LPAD(popt.products_options_sort_order,11,"0")';
                  } else {
                    
    $options_order_by' order by popt.products_options_name';
                  } 
    so finding where the PRODUCTS_OPTIONS_SORT_ORDER constant is defined/set will be helpful. It should be set in admin and stored in the database, but I'm not sure that constant name will help to track down the setting location.

  5. #5
    Join Date
    Jun 2010
    Posts
    207
    Plugin Contributions
    1

    Default Re: Flexible Attributes addon support

    Quote Originally Posted by gjh42 View Post
    attributes.php sets the query sort order with this:
    PHP Code:
                if ($pr_attr->fields['total'] > 0) {
                  if (
    PRODUCTS_OPTIONS_SORT_ORDER=='0') {
                    
    $options_order_by' order by LPAD(popt.products_options_sort_order,11,"0")';
                  } else {
                    
    $options_order_by' order by popt.products_options_name';
                  } 
    so finding where the PRODUCTS_OPTIONS_SORT_ORDER constant is defined/set will be helpful. It should be set in admin and stored in the database, but I'm not sure that constant name will help to track down the setting location.
    Hmmm... so the code says to order it by the sort order, and if that doesn't work then order them by option name in alphabetical order, right? It does indeed seem to be ordering it by name right now (Juice 1, Juice 2, Juice 3, Juice Choice, etc...). I wonder if that code could be tweaked to tell it to sort by ID instead, since I added the options in the order I want them to show up...


    I changed order by popt.products_options_name to order by popt.products_options_id and it looks like it's gonna work!!!! I need to add a few CSS modifications, but I think I'm on to something here. I'll post back here with my final results.
    Last edited by hockey2112; 18 Nov 2011 at 08:03 PM.

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

    Default Re: Flexible Attributes addon support

    Somehow there is a PRODUCTS_OPTIONS_SORT_ORDER constant that should be generated (or should be empty or '0' or null); if that is 0 then the correct sort order is used. If it has a nonzero value, then the name sort is used.

    So the real question is how to control that constant. If that can be done, the stock code will work correctly. Until then, a tweak may be what you need to get on with the rest of your work.

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

    Default Re: Flexible Attributes addon support

    I would copy the desired statement to replace the name statement for now:
    PHP Code:
                  if (PRODUCTS_OPTIONS_SORT_ORDER=='0') {
                    
    $options_order_by' order by LPAD(popt.products_options_sort_order,11,"0")';
                  } else {
                    
    //$options_order_by= ' order by popt.products_options_name';
                    
    $options_order_by' order by LPAD(popt.products_options_sort_order,11,"0")';
                  } 

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

    Default Re: Flexible Attributes addon support

    Oops, didn't see that the previous try at this post actually posted:)

    The corresponding database field stores the products_options_sort_order value, but I'm not sure where the PRODUCTS_OPTIONS_SORT_ORDER constant's value is set. It is not defined in a PHP file, so it must be set in admin and stored in the db, then retrieved at runtime. I've never been able to find out how/where stored settings are turned into constants for use.

  9. #9
    Join Date
    Jun 2010
    Posts
    207
    Plugin Contributions
    1

    Default Re: Flexible Attributes addon support

    Quote Originally Posted by gjh42 View Post
    Oops, didn't see that the previous try at this post actually posted:)

    The corresponding database field stores the products_options_sort_order value, but I'm not sure where the PRODUCTS_OPTIONS_SORT_ORDER constant's value is set. It is not defined in a PHP file, so it must be set in admin and stored in the db, then retrieved at runtime. I've never been able to find out how/where stored settings are turned into constants for use.

    I did a comparison of all files that contain "PRODUCTS_OPTIONS_SORT_ORDER" via Dev Toolkit in the localhost files and the live site files. the only difference I found was in admin/option_name.php:

    Localhost:
    Line #37 : $db->Execute("UPDATE " . TABLE_PRODUCTS_OPTIONS . " set products_options_sort_order= " . (int)$_POST['products_options_sort_order'][$id] . " where products_options_id=" . (int)$id . " and language_id=" . (int)$_GET['lng_id']);

    Live Site:
    Line #37 : $db->Execute("UPDATE " . TABLE_PRODUCTS_OPTIONS . " set products_options_sort_order= " . $_POST['products_options_sort_order'][$id] . " where products_options_id= $id and language_id=" . $_GET['lng_id']);

    I modified the live site's file to match the code in the localhost file, but it did not make any difference. Still stumped...

 

 

Similar Threads

  1. v154 Flexible Footer Menu Multilingual [Support Thread]
    By rbarbour in forum All Other Contributions/Addons
    Replies: 131
    Last Post: 29 Jun 2025, 03:06 AM
  2. v152 Flexible Language/Currency Header Options (Support Thread)
    By rbarbour in forum All Other Contributions/Addons
    Replies: 17
    Last Post: 20 May 2021, 03:46 PM
  3. v151 Flexible Return Authorization (RMA) for ZC v1.5.x [Support Thread]
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 167
    Last Post: 11 Apr 2021, 08:56 PM
  4. Flexible Product Listing [support]
    By gjh42 in forum All Other Contributions/Addons
    Replies: 27
    Last Post: 27 Apr 2015, 11:16 AM
  5. help with flexible product listing addon
    By artifaxworthing in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 19 Jun 2010, 11:25 AM

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