Page 4 of 4 FirstFirst ... 234
Results 31 to 36 of 36
  1. #31
    Join Date
    Aug 2013
    Location
    Perth, WA, AU
    Posts
    171
    Plugin Contributions
    3

    Default Re: PHP 8.0 - Search function not working properly following upgrade to 1.5.8

    Quote Originally Posted by mikeel100 View Post
    Price sorter is the sale price...
    I see, well I won't be doing that again..

  2. #32
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,591
    Plugin Contributions
    30

    Default Re: PHP 8.0 - Search function not working properly following upgrade to 1.5.8

    There is an explanation of price_sorter here
    https://docs.zen-cart.com/user/admin...store_manager/
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  3. #33
    Join Date
    Sep 2012
    Location
    West Jefferson, NC
    Posts
    383
    Plugin Contributions
    0

    Default Re: PHP 8.0 - Search function not working properly following upgrade to 1.5.8

    The search by date function is broken as well.

    In my unmodified cart, I changed the first graphic card due date to a couple of months out and made it zero balance.

    It shows up on the Upcoming Products list just fine, but when you search for 03/14/2024 to 05/15/2024, nothing comes back.

    It is definitely buggy.

    I'll see what I can figure out, but if someone knows the fix for this, I'd appreciate it.

  4. #34
    Join Date
    Sep 2012
    Location
    West Jefferson, NC
    Posts
    383
    Plugin Contributions
    0

    Default Re: PHP 8.0 - Search function not working properly following upgrade to 1.5.8

    Modifying the includes/modules/pages/search_result/header_php.php file fixed my date search problems and empty breadcrumb issues as well.

    Search for "mikeel100" in the attached header_php.zip file and you can see the changes I made.

    I also modified includes/init_includes/overrides/init_add_crumbs.php...see the zip file.

    Keep in mind, these attached files are from my customized cart where I have added center boxes for All Products, Upcoming, Price Range, Free Shipping, and Best Sellers. All of my center and sideboxes are pulled from a function I developed that totally bypasses modules and modules/sideboxes.

    All of the changes I made to these files may not work for you. It's a start though...and I hope it helps someone.
    Attached Files Attached Files

  5. #35
    Join Date
    Sep 2012
    Location
    West Jefferson, NC
    Posts
    383
    Plugin Contributions
    0

    Default Re: PHP 8.0 - Search function not working properly following upgrade to 1.5.8

    This constant, ADVANCED_SEARCH_NEW_PRODUCTS_DATE_FROM, in the init_add_crumbs files has to be in YOUR_TEMPLAGE/lang.english

    'ADVANCED_SEARCH_NEW_PRODUCTS_DATE_FROM' => '01/01/1900',

    $dfrom = ADVANCED_SEARCH_NEW_PRODUCTS_DATE_FROM has to be set in any link leading to New Products. In my case, it is in my custom function. You should find or put similar code in the modules and sideboxes new products files.

    PHP Code:
            case ADVANCED_SEARCH_HEADING_NEW_PRODUCTS:
                
    $dto date('m/d/Y');
                if (
    SHOW_NEW_PRODUCTS_LIMIT == 0) {
                    
    $dfrom ADVANCED_SEARCH_NEW_PRODUCTS_DATE_FROM;
                } else {
                    
    $dfrom strtotime '-' SHOW_NEW_PRODUCTS_LIMIT ' day' strtotime $date ) ) ;
                    
    $dfrom date('m/d/Y'$dfrom );
                } 

  6. #36
    Join Date
    Sep 2012
    Location
    West Jefferson, NC
    Posts
    383
    Plugin Contributions
    0

    Default Re: PHP 8.0 - Search function not working properly following upgrade to 1.5.8

    In trying fix an issue with the search engine where price from and price to do not go into the text boxes all the time, I've hit a snag that I can't explain and don't understand.

    My understanding of the process is that it starts in tpl_search_default.php and uses the $sData values from modules/pages/search/header_php.php...like so.

    PHP Code:
    $sData['pto'] = (isset($_GET['pto']) ? zen_output_string($_GET['pto']) : ''); 
    For troubleshooting purposes, I changed the above code to the code below...using 1000, '1000', and "1000" at many different points in my testing.

    PHP Code:
    $sData['pto'] = 1000
    In tpl_search_default.php, line 37, I tested if $sData['pto'] was available and correct...like so.

    PHP Code:
    <?php print_r('$sData[pto] before sanitizing = ' $sData['pto'] . '<br>'); //this is not making it's way into zen_draw_input_field('pto', $sData['pto'], 'id="pto"'); below 
    ?>
    <div id="searchPriceTo"><label for="pto"><?php echo ENTRY_PRICE_TO?></label><?php echo zen_draw_input_field('pto'$sData['pto'], 'id="pto"'); ?></div>
    It is available and correct but it is not getting into the text box.

    So I moved on to verifying function zen_draw_input_field in the html_output.php file.

    Around line 585, I tested for $value ($sData...).

    PHP Code:
    print_r('VALUE = ' $value);
        
    $field '<input type="' zen_output_string($type) . '" name="' zen_sanitize_string(zen_output_string($name)) . '"';
        if (isset(
    $GLOBALS[$name]) && is_string($GLOBALS[$name]) && $reinsert_value == true) {
          
    $field .= ' value="' zen_output_string(stripslashes($GLOBALS[$name])) . '"';
        } elseif (
    zen_not_null($value)) {
          
    $field .= ' value="' zen_output_string($value) . '"';
        }
    print_r('FIELD = ' $field ' | VALUE = ' $value); 
    $value is still correct and available but it still isn't inside of the text box...but it should be, right? The empty text box appears at is should...other than being empty.

    My confusion comes here while anylizing the above code. Why would you use $name in any part of this if statement below? The goal is to set $field .= ' value=" to the $value...not the $name, right?

    PHP Code:
        if (isset($GLOBALS[$name]) && is_string($GLOBALS[$name]) && $reinsert_value == true) {
          
    $field .= ' value="' zen_output_string(stripslashes($GLOBALS[$name])) . '"';
        } 
    So, I changed $name to $value and the text box now has the correct value in it.

    Now, I'm reluctant to leave it this way because this function is WIDELY used throughout the programming.

    My question, is this a good fix and a BUG?

    I have no idea where the search engine NOTIFY system is located nor do I understand how the "watcher class" system works...so I couldn't analyze it.

    I would appreciate some insight and help please.

 

 
Page 4 of 4 FirstFirst ... 234

Similar Threads

  1. Search function not working properly (collation problem)
    By dennisysh in forum General Questions
    Replies: 9
    Last Post: 27 Apr 2010, 05:27 PM
  2. Search function no longer working after doing an upgrade...
    By accension in forum General Questions
    Replies: 5
    Last Post: 24 Jan 2008, 11:19 PM
  3. My search function does not work properly
    By idtags in forum General Questions
    Replies: 2
    Last Post: 1 Nov 2007, 05:40 PM
  4. Search function not working properly
    By THISclose in forum Setting Up Categories, Products, Attributes
    Replies: 9
    Last Post: 4 Mar 2007, 07:00 PM

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