• Plugin is not working with divi theme. Search result shows empty/blank page.

    Do we have any idea how it works on divi theme?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hello,

    This search plugin was tested for Divi theme and must works fine with it.
    Maybe you have some other plugins that has conflict with AWS plugin?

    Regards

    Thread Starter hassnain48

    (@hassnain48)

    Hi,

    Divi search result issue is fixed now. Issue is from divi end.

    Is there any way we can sort the out of stock products at end of search result page?

    Plugin Author ILLID

    (@mihail-barinov)

    Yes, it is possible.

    Please add following code to your theme functions.php file. Also after this please go to plugin settings page and click on ‘Clear cache’ button.

    add_filter( 'aws_search_results_products', 'aws_search_results_products' );
    function aws_search_results_products( $products ) {
        usort($products, function ($item1, $item2) {
            if ( isset( $item1['stock_status']['status'] ) && isset( $item2['stock_status']['status'] ) ) {
                if ( $item1['stock_status']['status'] ) {
                    return -1;
                } else if ( $item2['stock_status']['status'] ) {
                    return 1;
                } else {
                    return 0;
                }
            } else {
                return 0;
            }
        });
        return $products;
    }

    Hi,

    In functions.php file, where exactly we have to paste this code?

    Thank you.

    Plugin Author ILLID

    (@mihail-barinov)

    Please add this code to the very end of functions.php file

    Thread Starter hassnain48

    (@hassnain48)

    Added above script in functions.php file but its not working completely.

    Search field suggestions are sorted but search result page products are not sorting in/out of stock.

    Plugin Author ILLID

    (@mihail-barinov)

    Also after code changes please go to plugin settings page and click on ‘Clear cache’ button.

    Thread Starter hassnain48

    (@hassnain48)

    Hi, cleared cache also but still search result page is not showing product by in-stock first.

    Take a look at given link
    https://www.birchandfog.com/?s=chocolates&post_type=product&type_aws=true

    Thread Starter hassnain48

    (@hassnain48)

    Hi, any update on this?

    @hassnain48 How did you fix the issue on Divi’s end?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Divi search result’ is closed to new replies.