• Resolved lortan29

    (@lortan29)


    Hello. I have products on my site that have a size attribute of 10 x 10 x 10 in the name, but these products are not found in a search without spaces, an example of a request is 10x10x10. Is it possible to solve this?

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

Viewing 1 replies (of 1 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    Please try to use following code snippet:\

    add_filter( 'aws_search_terms', 'aws_search_terms' );
    function aws_search_terms( $terms ) {
        if ( $terms ) {
            foreach ($terms as $term) {
                preg_match_all('/([0-9]+|[a-zA-Z]+)/',$term,$matches);
                if ( ! empty( $matches ) ) {
                    $terms = array_merge( $terms, $matches[0] );
                }
            }
        }
        return $terms;
    }

    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 the ‘Clear cache’ button.

    Regards

Viewing 1 replies (of 1 total)
  • The topic ‘Search By Attribute Problem’ is closed to new replies.