Support » Plugin: Advanced Woo Search » SEARCH BY ID

  • Resolved uben

    (@uben)


    FRIEND I WOULD LIKE TO SEARCH BY ID , THERE IS SOME WAY YOU CAN PLEASE HELP ME OR I WOULD PAY YOU FOR YOUR WORK, THANK YOU

    I tried to contact you but I can’t

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

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

    (@mihail-barinov)

    Hello,

    Please add following code snippet

    add_filter( 'aws_indexed_title', 'my_aws_indexed_title', 10, 3 );
    function my_aws_indexed_title( $title, $id, $product ) {
        $title = $title . ' ' . $id;
        return $title;
    }

    After go to plugin settings page and click ‘Reindex table’ button. Also make sure that ‘Title’ search source available for search.
    Now it is possible to search via product ID.

    Regards

    http://prntscr.com/owtzle
    http://prntscr.com/owtzp2
    http://prntscr.com/owu36v

    thank you very much friend you are very kind, could you also help me to look for variations of a product please kindly. I hope not to bother you

    Plugin Author ILLID

    (@mihail-barinov)

    So, as I understand, you want also to search for variable product ID and see in search results parent product for this variation.
    Is that true?

    Regards

    yes, my friend

    help please

    Plugin Author ILLID

    (@mihail-barinov)

    In this case please modify code above to

    add_filter( 'aws_indexed_title', 'my_aws_indexed_title', 10, 3 );
    function my_aws_indexed_title( $title, $id, $product ) {
        $title = $title . ' ' . $id;
        if ( $product->is_type( 'variable' ) && class_exists( 'WC_Product_Variation' ) ) {
            if ( sizeof( $product->get_children() ) > 0 ) {
                foreach ( $product->get_children() as $child_id ) {
                    $title = $title . ' ' . $child_id;
                }
            }
        }
        return $title;
    }
Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.