kyoto Posted October 3, 2013 Share Posted October 3, 2013 hi please people, i need ur help here!! I need to update some new columns that i already added in my "orders" table, but i cant make it work! since i added some info manually in the DDBB, I'm already showing that info in my orders list, in the B.O., no problem... Now i need to make the correct code/SQL query in order to update that fields in that table. Best regards pals and hope u can help me :) Link to comment Share on other sites More sharing options...
vekia Posted October 3, 2013 Share Posted October 3, 2013 hi please people, i need ur help here!! I need to update some new columns that i already added in my "orders" table, but i cant make it work! since i added some info manually in the DDBB, I'm already showing that info in my orders list, in the B.O., no problem... Now i need to make the correct code/SQL query in order to update that fields in that table. Best regards pals and hope u can help me :) can you shed something more about it? where you display these fields? you added them to ps_orders table? Link to comment Share on other sites More sharing options...
kyoto Posted October 3, 2013 Author Share Posted October 3, 2013 Vekia thanks a lot for ur help Look, i added those columns in the ps_orders table. I can also show their info in my orders list in the B.O., but i dont know how to make the update when the admin change the order status to 'payment accepted'. Some screen captures: 1. i calculate the commission of each order, (done with jQuery/PHP in the view. tpl file, works perfect!!). https://www.dropbox.com/s/2wpmfk8vup5os80/Screen%20Shot%202013-10-03%20at%2011.22.24.png 2. i added these columns in the "orders" table, and added some info manually in the DDBB... https://www.dropbox.com/s/4yjgfsda6wejyeo/Screen%20Shot%202013-10-03%20at%2011.21.57.png 3. i can read those fields in my orders list in the B.O. https://www.dropbox.com/s/bvn50wupkx0xu5x/Screen%20Shot%202013-10-03%20at%2011.22.10.png 4. when admin change the order status to "payment accepted", i wanna update the orders table, obviously only this column --> "salesmanCommission" with the value i already calculated in the order info tab; (Point 1 here). https://www.dropbox.com/s/5uz2gszolawrv8k/Screen%20Shot%202013-10-03%20at%2011.22.16.png Link to comment Share on other sites More sharing options...
kyoto Posted October 3, 2013 Author Share Posted October 3, 2013 (edited) I could find the correct line in the "AdminOrdersController.php", i wrote this update code... https://www.dropbox.com/s/zgtpzijzwq6ytsr/Screen%20Shot%202013-10-03%20at%2011.59.17.png -->but i got this error... https://www.dropbox.com/s/pzy6y3ldpyoh3wg/Screen%20Shot%202013-10-03%20at%2011.59.02.png Do i need to write all the orders table columns in the update?. Thanks a lot!! Edited October 3, 2013 by kyoto (see edit history) Link to comment Share on other sites More sharing options...
kyoto Posted October 3, 2013 Author Share Posted October 3, 2013 I could solve this peeps :) Now, i need some help in a couple of things!. U see, i calculate the commission value in the "view.tpl" file, using jQuery/PHP, heres my big Q.. How can i get that value and how can i pass it to my php file from the tpl? THANKS A LOT!! Link to comment Share on other sites More sharing options...
Recommended Posts