Home Forums WoodMart support forum Search on sku not working

Search on sku not working

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #306629

    webreturn
    Participant

    Hi,
    Search on sku is working in the search field: https://prnt.sc/1b21l9y
    But when you click enter it is not showing any result?
    https://www.truckonderdelenshop.nl/?s=455073&post_type=product
    How can we fix this?
    Best regards, Tim

    #306634

    Artem Temos
    Keymaster

    Hello,

    Could you please disable all plugins that are not related to our theme and provide us your admin and FTP access so we can check it? Also, send us a link to the product with this SKU.

    Thank you in advance

    #306864

    webreturn
    Participant

    Hi,

    We haven’t any plugins who can do do this. None of the sku’s are shown. Please check https://www.truckonderdelenshop.nl/duo-matic-adapter-gesloten/

    Search on 016192 it can’t find it:

    https://www.truckonderdelenshop.nl/?s=016192&post_type=product

    Search into the product name is working: https://www.truckonderdelenshop.nl/?s=matic+adapter&post_type=product

    There is only a problem that the sku is not searchable? This isn’t a setting?

    Best regards, Tim

    #306887

    Artem Temos
    Keymaster

    Please, send us your admin access so we can check the configuration. The only option for this can be found in Theme Settings -> Shop.

    #307471

    webreturn
    Participant

    Hi,

    See below the login of wordpress.

    #307473

    Artem Temos
    Keymaster

    Hello,

    It seems to be an issue with the latest WooCommerce version already reported by other themes as well https://github.com/woocommerce/woocommerce/issues/30298 As a workaround, you can edit the file wp-content\plugins\woocommerce\includes\class-wc-query.php and replace the following code

    private function product_query_post_clauses( $args, $wp_query ) {
        $args = $this->price_filter_post_clauses( $args, $wp_query );
        $args = $this->filterer->filter_by_attribute_post_clauses( $args, $wp_query, $this->get_layered_nav_chosen_attributes() );
        $search = $this->get_main_search_query_sql();
        if ( $search ) {
            $args['where'] .= ' AND ' . $search;
        }
        return $args;
    }

    with the following one

    private function product_query_post_clauses( $args, $wp_query ) {
        $args = $this->price_filter_post_clauses( $args, $wp_query );
        $args = $this->filterer->filter_by_attribute_post_clauses( $args, $wp_query, $this->get_layered_nav_chosen_attributes() );
        return $args;
    }

    Kind Regards

    #307545

    webreturn
    Participant

    Thanks!

    #307554

    Artem Temos
    Keymaster

    You are welcome! If you have any questions please feel free to contact us.

    Best Regards

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Search on sku not working’ is closed to new replies.