I am developing an e-Commerce theme and got stuck on how to add an order page in the theme folder. Sorry if this question sounds silly to you. I am new to wordpress and this is my first project. I have done researches but couldn't figure it out.
I have successfully created customized post type and meta datas, now I have a "buy now" button on the product page to link to another php file in the same theme folder. This php file takes the product id and then calculate the price, redirects user to the payment page after checkout.
But then I realized that the url would look ugly:
http://www.example.com/wp-content/themes/mytheme/order.php?product_id=001
I know I can place the php file in the wordpress root folder, but I am just curious: there are lots of e-Commerce themes, how did they handle this kind of situation?