Jump to content

CheckOutScript - Copy of order Email


Adam

Recommended Posts

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

*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

*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

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

*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

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

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

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

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

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

  • 3 weeks later...

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 :P

 

Thanks :)

Link to comment
Share on other sites

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

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated