mysql - In OpenCart, how to pass information to a separate PHP script? -


in opencart 2.3.0.2, i'm trying create button in admin section appear on each order. clicking button should generate .txt file containing information order (customer shipping address, items ordered, etc.) in specified folder on server.

in previous environment (oscommerce), able achieve having button form input, post order id php script, use order id fetch required order information database , write text file using fopen/fwrite/fclose. script update order status note saying text file created.

i guess boils down is, there way in opencart pass order information separate php script not natively part of opencart structure?

  1. create function in controller, want update order status , write order content in file using fwrite.

  2. modify "admin/view/template/sale/order_info.tpl". can add button in html , using jquery, add onclick function.

  3. in function, can send ajax request controller. can receive file path of txt file in ajax.

  4. then open path jquery using "window.open(path);" function

hope, helps


Comments