Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2005
    Posts
    309
    Plugin Contributions
    0

    Default Admin Specials and Featured Sort order

    dev.pezcollectors.com ZC1.5.8a PHP 8.1.24
    In Admin, Catalog, Specials or Featured, THEN Add Special by Selection - Products are ordered by product model and I want to change it to products_id DESC.
    In 157 I could just change the line
    Code:
    $prev_next_order = ' ORDER BY
    but in 1.5.8 this seems to have no effect. Probably because of the addition of the search.
    Any suggestions?
    2 + 2 = 5 for extremely large values of 2

    Pez Collectors Store

  2. #2
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,694
    Plugin Contributions
    9

    Default Re: Admin Specials and Featured Sort order

    few things:

    • what a pain!
    • good catch, this is a bug.
    • have you played around with the new searching? it is quite powerful. and only requires partial word matches; ie searching for 'great product', would return a product whose name is 'greatest product'.


    that said, find this line of code:

    https://github.com/zencart/zencart/b...ories.php#L339

    and change it to:

    PHP Code:
    $order_by str_replace(['pd.''p.'], ''zen_products_sort_order(false)); 
    the sorting is then controlled by this constant:

    PRODUCT_INFO_PREVIOUS_NEXT_SORT

    which is available by searching using the developers tool kit; or by admin -> configuration -> product info.

    let us know if that fixes the bug for you.

    note that the sorting is the same as is used on the storefront.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  3. #3
    Join Date
    Jun 2005
    Posts
    309
    Plugin Contributions
    0

    Default Re: Admin Specials and Featured Sort order

    Interesting. The change made no change on the storefront that I can find. It DID fix a separate issue on featured when selecting a product would randomly change the sort order but could mean that what you selected was on the next page. Under add by selection, it changed the sort to Product Name Alpha ASC. So kinda getting there, but my goal is still for add by selection to be product_id DESC. Actually, as long as I'm begging, the ideal would be date added descending, but assuming we don't have that bit of data here, id should be close enough.

    Search is great, but most of the time the user want to go put the 10 new products she added on featured or special, so having them at the top is her ideal.
    2 + 2 = 5 for extremely large values of 2

    Pez Collectors Store

  4. #4
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,694
    Plugin Contributions
    9

    Default Re: Admin Specials and Featured Sort order

    Quote Originally Posted by gothstone View Post
    Interesting. The change made no change on the storefront that I can find. It DID fix a separate issue on featured when selecting a product would randomly change the sort order but could mean that what you selected was on the next page. Under add by selection, it changed the sort to Product Name Alpha ASC. So kinda getting there, but my goal is still for add by selection to be product_id DESC. Actually, as long as I'm begging, the ideal would be date added descending, but assuming we don't have that bit of data here, id should be close enough.

    Search is great, but most of the time the user want to go put the 10 new products she added on featured or special, so having them at the top is her ideal.
    pezman,
    i'm not here to acquiesce to your every request. i'm here to fix bugs.

    if you want to change other sorting options, i would suggest you open a PR on the ZC github repo. barring that, i would suggest hiring one of the talented (or not so talented) coders on this board. if you need a recommendation, feel free to PM me.

    i would suggest you re-read my first post. i did not say that coding change would affect the storefront; i said changing the constant will change the sorting on the storefront. however, in thinking about it, it is entirely possible that your template could be over-riding it.

    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  5. #5
    Join Date
    Jun 2005
    Posts
    309
    Plugin Contributions
    0

    Default Re: Admin Specials and Featured Sort order

    I'm sorry, I didn't mean to offend. I'll keep playing with it on my own.
    2 + 2 = 5 for extremely large values of 2

    Pez Collectors Store

  6. #6
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,694
    Plugin Contributions
    9

    Default Re: Admin Specials and Featured Sort order

    Quote Originally Posted by gothstone View Post
    I'm sorry, I didn't mean to offend. I'll keep playing with it on my own.
    no offense taken....
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  7. #7
    Join Date
    Jun 2005
    Posts
    309
    Plugin Contributions
    0

    Default Re: Admin Specials and Featured Sort order

    Notes for the next person who finds this in search:
    After applying bugfix, admin/config/product info/prev next sort order DOES set order for product by selection, but no DESC is available.
    That select box is drawn on line 255 for featured. 2 lines up is an ORDER BY function. Unfortunately, it doesn't do anything that I can find.
    Bad fix for now: insert between </div> tags at lines 257
    Code:
    <script>
    var select = $('select');
      select.html(select.find('option').sort(function(x, y) {
        var num1 = parseInt($(x).text());
        var num2 = parseInt($(y).text());
            return num1> num2 ? 1 : -1;
      }));
    </script>
    It's an ugly hack, but it works.
    2 + 2 = 5 for extremely large values of 2

    Pez Collectors Store

 

 

Similar Threads

  1. v154 Randomize sort order for Specials or Featured
    By bravo685 in forum General Questions
    Replies: 1
    Last Post: 8 Sep 2015, 12:20 PM
  2. Sort order :: specials products
    By xergos055 in forum Setting Up Specials and SaleMaker
    Replies: 24
    Last Post: 12 Nov 2012, 09:54 AM
  3. Featured Product Sort Order!?!?!?
    By flipjargendy in forum General Questions
    Replies: 9
    Last Post: 15 Dec 2010, 09:30 PM
  4. Specials Box - sort order
    By skype55 in forum Setting Up Specials and SaleMaker
    Replies: 1
    Last Post: 24 Feb 2008, 03:47 AM
  5. Switch order of Specials and Featured on Main Page (Issue)
    By psychicpet in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 23 Jan 2008, 08:10 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