Adam Posted February 24, 2007 Share Posted February 24, 2007 Hey, I have seen a few people request for or ask how would one able to do this. I have used this for a long time and I'm now sharing it with everyone. Since this is a customization to WHMCS, you will NOT be able to get support from WHMCS Staff at all! All support for this script will need to be handled via this forum post only! What does the script do? - When a new order is placed, you will get an email sent to you (of your choice) of what the customer order! Thats it. You can download this script at the following location, http://dev.eastsolid.com/STABLE/whmcs/checkoutscript/ How do I install it? - Replace the attached file checkoutscript.php in your includes folder of WHMCS. You can read the "OPEN ME.txt" file in the zip file. If you find any bugs - PLEASE POST THEM If you run into any problems or have any questions or and comments post them below! Enjoy, Adam Link to comment Share on other sites More sharing options...
tj Posted February 24, 2007 Share Posted February 24, 2007 that's brilliant!! ill give this a try later today tell you how it goes! thank you! Link to comment Share on other sites More sharing options...
ASMHosting Posted February 24, 2007 Share Posted February 24, 2007 Oh this is handy I'm just modifying it a little to work with ClickATell's SMS API so that I get alerted to order's even when not at a computer. Link to comment Share on other sites More sharing options...
tj Posted February 24, 2007 Share Posted February 24, 2007 *cough* u know you want to share it with us EDIT: Ok was hoping someone could help me out I grabbed Adam's script, but I only need it to e-mail a specific address when specific products are ordered. So with the help of a friend got: if ($productid == '14' || $productid == '15' || $productid == '16' || $productid == '17' || $productid == '18' ) { Which I pasted right before Adam's code. Then at the end of all the code, put: } else { } Any ideas? Thanks! Link to comment Share on other sites More sharing options...
Patty Posted February 24, 2007 Share Posted February 24, 2007 So WHMCS doesn't send an email to admin when a new order is placed?? Link to comment Share on other sites More sharing options...
tj Posted February 24, 2007 Share Posted February 24, 2007 Yes it does!! But this is just customising further e-mails Link to comment Share on other sites More sharing options...
Patty Posted February 24, 2007 Share Posted February 24, 2007 Oh, OK. Thank you. Link to comment Share on other sites More sharing options...
ASMHosting Posted February 24, 2007 Share Posted February 24, 2007 *cough* u know you want to share it with us I will if it work's ok and Adam doesn't have any problems with that, after all it still use's half his code for the MySQL stuff -Edit- Does anyone know if ordering "Free" product's will call the checkoutscript.php? I can't think of any other way of testing it properly.... If it does then something's broke, if it doesn't that'd explain it lol. Link to comment Share on other sites More sharing options...
Adam Posted February 24, 2007 Author Share Posted February 24, 2007 that's brilliant!! ill give this a try later today tell you how it goes! thank you! Oh this is handy I'm just modifying it a little to work with ClickATell's SMS API so that I get alerted to order's even when not at a computer. Hey, Thanks! Let me know if you run into any bugs or anything. From, Adam Link to comment Share on other sites More sharing options...
Adam Posted February 24, 2007 Author Share Posted February 24, 2007 *cough* u know you want to share it with us EDIT: Ok was hoping someone could help me out I grabbed Adam's script, but I only need it to e-mail a specific address when specific products are ordered. So with the help of a friend got: if ($productid == '14' || $productid == '15' || $productid == '16' || $productid == '17' || $productid == '18' ) { Which I pasted right before Adam's code. Then at the end of all the code, put: } else { } Any ideas? Thanks! Hey, What you want to do is add that code around line 214 or right before the $message option. (The IF part) Then add the else part right after line 260 or when you are sending out mail. I added a sh*t load of comments so it would be easy to know where everything is and how easy it is to do what ever you want with it. From, Adam Link to comment Share on other sites More sharing options...
Adam Posted February 24, 2007 Author Share Posted February 24, 2007 Does anyone know if ordering "Free" product's will call the checkoutscript.php? I can't think of any other way of testing it properly.... If it does then something's broke, if it doesn't that'd explain it lol. Hey, It should. Because this checkoutscript runs on every order doesn't matter if its free, paid or what. However I have not tested it out with a free product as I don't sell them. (pun) Make sure you have the option Run "Checkoutscript" in the WHMCS Admin Panel Configuration > General Configuration > Other. From, Adam Link to comment Share on other sites More sharing options...
ASMHosting Posted February 24, 2007 Share Posted February 24, 2007 Yea, I thought it should, and double and tripple checked to make sure that was enabled but still doesn't seem to attempt to run it. Chucking a free product in hidden was the best way I could think of testing it.... Is there a debug mode or anything like that in WHMCS? Link to comment Share on other sites More sharing options...
tj Posted February 24, 2007 Share Posted February 24, 2007 Hey, What you want to do is add that code around line 214 or right before the $message option. (The IF part) Then add the else part right after line 260 or when you are sending out mail. I added a sh*t load of comments so it would be easy to know where everything is and how easy it is to do what ever you want with it. From, Adam Thanks Adam, but my php skills are non-existant! I'll give that a try Link to comment Share on other sites More sharing options...
Adam Posted February 24, 2007 Author Share Posted February 24, 2007 Yea, I thought it should, and double and tripple checked to make sure that was enabled but still doesn't seem to attempt to run it. Chucking a free product in hidden was the best way I could think of testing it.... Is there a debug mode or anything like that in WHMCS? Hey, I'll run a few test on my local install. As for debug, add the following to your configuration.php $display_errors="on"; and place a test order. You should be able to see any errors if their are any. Once done, comment out that line or just deleted it. Thanks Adam, but my php skills are non-existant! I'll give that a try Let me know how it turns out, if not I'll send you the way it should look like. From, Adam Link to comment Share on other sites More sharing options...
CSNM-Carl Posted February 25, 2007 Share Posted February 25, 2007 Hi, So does this script/addon email us with all the data from the order form including any custom fields? Thanks, Carl Link to comment Share on other sites More sharing options...
Adam Posted February 25, 2007 Author Share Posted February 25, 2007 Hi, So does this script/addon email us with all the data from the order form including any custom fields? Thanks, Carl Hey, No, you will need to add any custom fields to the SQL query and then give it a variable. Thats it really.... From, Adam Link to comment Share on other sites More sharing options...
yabado Posted March 2, 2007 Share Posted March 2, 2007 Adam, Is $orderid the only data variable available to the script? Link to comment Share on other sites More sharing options...
tj Posted March 2, 2007 Share Posted March 2, 2007 If you open the script there is a list of all the variables that are available to use. Link to comment Share on other sites More sharing options...
yabado Posted March 2, 2007 Share Posted March 2, 2007 Doh! Sorry. Link to comment Share on other sites More sharing options...
ramystyle Posted March 20, 2007 Share Posted March 20, 2007 Hey Adam, I installed your script and it works Great !! The only thing is that when i got the email, everything was on the same line.. Order ID: 40 Order Number: 8101074507 Timestamp: Tuesday March 20th, 2007 - 05:11 PM --- etc... Is there a way to put each output on a different line? Like this Order ID: 40 Order Number: 8101074507 Timestamp: Tuesday March 20th, 2007 - 05:11 PM --- etc... I must warn you that my php skills are non existant Thanks Link to comment Share on other sites More sharing options...
Adam Posted March 21, 2007 Author Share Posted March 21, 2007 Hey, Well I know that for my help desk it adds a line break already, however you can add the following to space a line. From the file around lines 215 - 256 $message = " --------------------------------------------------------- Order Information --------------------------------------------------------- Order ID: $orderid Order Number: $ordernumber Timestamp: $datetimefull You should change to $message = " --------------------------------------------------------- Order Information --------------------------------------------------------- Order ID: $orderid Order Number: $ordernumber Timestamp: $datetimefull Anytime you want a new line add and your good to go. Do that for the whole message variable which is from lines 215 - 256 From, Adam Link to comment Share on other sites More sharing options...
ramystyle Posted March 21, 2007 Share Posted March 21, 2007 Thanks Adam ! It worked Good job on the script ! Link to comment Share on other sites More sharing options...
Adam Posted March 21, 2007 Author Share Posted March 21, 2007 Thanks Adam ! It worked Good job on the script ! Hey, Thanks From, Adam Link to comment Share on other sites More sharing options...
haner Posted March 21, 2007 Share Posted March 21, 2007 Now if only we can get the new order form with bucketshop's template with the big red boxes for errors, this would be the ultimate whmcs template package Link to comment Share on other sites More sharing options...
Adam Posted March 21, 2007 Author Share Posted March 21, 2007 Now if only we can get the new order form with bucketshop's template with the big red boxes for errors, this would be the ultimate whmcs template package Hey, Already done, http://forums.whmcs.com/viewtopic.php?t=3409 From, Adam Link to comment Share on other sites More sharing options...
Recommended Posts