how query string in wordpress receive the value other than post and page [duplicate]

I’m afraid I don’t understand exactly what the problem is so I guess you want just add *product_id* as a query var:

function my_add_query_vars( $qv = array() ) {
    $qv[] = 'product_id';
    return $qv;
}
add_filter( 'query_vars', 'my_add_query_vars' );