Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    bug BannersAll sort order fix

    Minor change may help correct sort order issues in BannersAll

    Condition: Sort order is not being followed - Stock Responsive Classic Template.

    Found in:
    includes/templates/YOUR_TEMPLATE/sideboxes/tpl_banner_box_all.php
    line 22
    $sql = "select banners_id from " . TABLE_BANNERS . " where status = 1 " . $new_banner_search . $my_banner_filter . " order by banners_sort_order";

    The Fix:
    $sql = "select banners_id from " . TABLE_BANNERS . " where status = 1 " . $new_banner_search . $my_banner_filter . " order by banners_sort_order asc"; // Twitch fix banners display sort order


    Now my banners follow the correct sort order.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,486
    Plugin Contributions
    88

    Default Re: BannersAll sort order fix

    What version of MySQL? The default for the ORDER BY clause is ASC (https://www.w3schools.com/sql/sql_orderby.asp_/

  3. #3
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: BannersAll sort order fix

    Quote Originally Posted by lat9 View Post
    What version of MySQL? The default for the ORDER BY clause is ASC (https://www.w3schools.com/sql/sql_orderby.asp_/
    It may be an indexing issue based on this mysql document: https://dev.mysql.com/doc/refman/8.0...imization.html

    Effectively indicating that optimization may use the index instead of the value(s) in the order by field if optimization identifies that the index is faster...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: BannersAll sort order fix

    There is an SQL version mismatch, this is the fix for when you have no choice and it needs to work. This also prevents 'guessing' or any random/inconsistent looking sort order.

    Solid state coding is more reliable.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

 

 

Similar Threads

  1. v151 Product Sort within Category - having problems changing the default sort order
    By Don Wagner in forum Customization from the Admin
    Replies: 4
    Last Post: 21 Oct 2012, 03:03 AM
  2. Group Pricing Per Item - sort products by price issue, suggested code to fix
    By swagmani in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 2 Mar 2011, 04:14 PM
  3. Sort Order - All - sort by a-z (show a - c, etc)
    By kiermasz in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 4 Jun 2008, 09:43 PM
  4. BannersAll in footer?
    By bestore in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 19 Dec 2007, 11:36 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