Problem#1:
You can create a customized php file for your page using a Page Template
Page Templates
WordPress looks for template files in the following order:
- Page Template — If the page has a custom template assigned, WordPress looks for that file and, if found, uses it.
- page-{slug}.php — If no custom template has been assigned, WordPress looks for and uses a specialized template that contains the
page’s slug.- page-{id}.php — If a specialized template that includes the page’s slug is not found, WordPress looks for and uses a specialized template
named with the page’s ID.- page.php — If a specialized template that includes the page’s ID is not found, WordPress looks for and uses the theme’s default page
template.- index.php — If no specific page templates are assigned or found, WordPress defaults back to using the theme’s index file to render
pages.
In your scenario, your page template file would be page-order-page.php, wordpress would then load that file for when someone accesses (example.com/order-page).
Problem#2:
For problem 2, you would need to register query variables using the query_vars
filter.
function wpse169050_register_query_vars( $vars ) {
$vars[] = 'product_id';
$vars[] = 'type';
return $vars;
}
add_filter( 'query_vars', 'wpse169050_register_query_vars' );
Your order url with the variables would then be
example.com/order-page/?product_id=001&type=digital
You can then get the value for both variables using get_query_var
in your template file:
$product_id = get_query_var('product_id');
$type = get_query_var('type');