• Resolved imloic

    (@imloic)


    Hello,

    Since the last update with WPML (or maybe WooCommerce) I got a critical error when I search for a specific reference; ex. PLT PRO. PLease check capture

    https://ibb.co/mv2wNzF

    Thanks

    • This topic was modified 1 year, 8 months ago by imloic.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter imloic

    (@imloic)

    EDIT: OK. The problem is from a snippet. Error when I hit “enter” when I search PLT PRO. So I remove all snippets and it’s WORK! No error on this REF
    Please check these 2 captures, it’s very strange,

    https://ibb.co/RHvSjZm

    Second capture, I see stock and I don’t see the brand (so my snippet doesn’t work ??)

    https://ibb.co/3Y2qjgF

    • This reply was modified 1 year, 8 months ago by imloic.
    • This reply was modified 1 year, 8 months ago by imloic.
    • This reply was modified 1 year, 8 months ago by imloic.
    • This reply was modified 1 year, 8 months ago by imloic.
    • This reply was modified 1 year, 8 months ago by imloic.
    Thread Starter imloic

    (@imloic)

    Ok problem with this snippet

    /**
     * resultat recherche par prix decroissant 
     */ 
    
    add_filter( 'aws_search_results_products', 'my_aws_search_results_products' );
    function my_aws_search_results_products( $products ) {
        usort($products, function ($item1, $item2) {
            $a = intval( $item1['f_price'] * 100 );
            $b = intval( $item2['f_price'] * 100 );
            if ($a == $b) {
                return 0;
            }
            return ($a > $b) ? -1 : 1;
        });
        return $products;
    }
    
    

    I would like to show Highest price first and I’m not sure of this. But this work for

      return ($a > $b) ? -1 : 1;
        });
        return $products;
    }
    • This reply was modified 1 year, 8 months ago by imloic.
    Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    Strange that you have an issue with this code snippet. It looks correct.

    Please try the following – enable debug mode like described in this article and then check for any errors inside your debug.log file.

    Regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Critical error when search a reference’ is closed to new replies.