• Resolved natsshop

    (@natsshop)


    Hi,
    Is it possible to hide products with a price of € 0.00 in the search result?
    Thank you for an answer.
    Gisela

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

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

    (@mihail-barinov)

    Hello,

    Please use following code snippet

    add_filter( 'aws_search_results_products', 'my_aws_search_results_products', 10, 2 );
    function my_aws_search_results_products( $products_array, $s ) {
        $new_array = array();
        foreach ( $products_array as $product  ) {
            if ( ! isset( $product['f_price'] ) || intval( $product['f_price'] ) !== 0 ) {
                $new_array[] = $product;
            }
        }
        return $new_array;
    }

    You need to add it somewhere outside the plugins folder. For example, inside functions.php file of your theme or use some plugin for adding code snippets.

    Also after adding this code you will need to go to the plugin settings page and click ‘Clear cache’ button.

    Thread Starter natsshop

    (@natsshop)

    Hello,
    Thank you very much, it works perfectly.
    Greetings Gisela

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide products with zero price’ is closed to new replies.