PDA

View Full Version : On checkout



tj
02-19-07, 12:15 PM
Anyone want to share how they are using the on checkout script?

I'm about to get my hands dirty and hope my php skills are up to it!

Anyone got something like,

if $product = x
sendmail ?

Thanks :)

DataHosts
02-19-07, 01:32 PM
enclose the php script as follows:
{php}your code{/php}

tj
02-19-07, 02:24 PM
gotta write it first ;)

DataHosts
02-19-07, 06:47 PM
gotta write it first ;)

lol..yes...that would help out.

tj
02-19-07, 06:51 PM
Which is why I was asking if someone has written a script similar to the one I was asking for? :)

Adam
02-19-07, 07:39 PM
Hey,

For the checkout script, I don't think you use {php} as its not in the smarty system, but as its a PHP file.

So you should use <?php or if you are lazy <?

From,
Adam

tj
02-19-07, 07:43 PM
Ok people thank you for all the info, much appreciated. Yes I am lazy and no im not a complete n00b in regards to how PHP works.

What I'm asking, requesting is:

Does anyone here have a script ready to go that e-mails a specific e-mail address if product x is ordered that I can just dump in the checkout.php file, before I go and write one up.

Thank you.

Adam
02-19-07, 08:52 PM
Ok people thank you for all the info, much appreciated. Yes I am lazy and no im not a complete n00b in regards to how PHP works.

What I'm asking, requesting is:

Does anyone here have a script ready to go that e-mails a specific e-mail address if product x is ordered that I can just dump in the checkout.php file, before I go and write one up.

Thank you.

Hey,

In the check out script you can use the different variables to do a search in the database and pull information out from different tables.

I might make a post on how to do this, of even give out my checkoutscript.php

From,
Adam

tj
02-19-07, 08:56 PM
Would be greatfull if you did!



Run Script on Checkout - ticking this box means the script in the file "includes/checkoutscript.php" will be run when an order is placed. This can be used for running your own script to perform an action when an order is placed. You can use the variables $hostingid and $domainid in this file to retrieve data from the database about the order.


Thats all the info I can find on the subject...

Does that mean i can write something like,

if $hostingid = shell
sendmail?

Matt
02-19-07, 09:03 PM
If you look inside the file you'll see it says the following:


**************************************************
************** WHMCS CheckOut Script *************
**************************************************
You may enter code here which will be run when
a user checks out if you have enabled it in
Configuration > General Configuration > Other
of your WHMCS Admin Area. The following
variables are available to you:
**************************************************
Order ID: $orderid
Order Number: $ordernumber
Invoice ID: $invoiceid
Product ID: $productid
Domain ID: $domainid
Addons Array: $addons
**************************************************

Therefore, you can run a query using the $orderid or $productid to see what was ordered and do something for certain products. The most common use of the checkout script is for integrating things like third party affiliate scripts or sales tracking software but you could do something like you suggest if you wanted.

Matt

tj
02-20-07, 07:41 PM
Thank you Mattt.

Adam
02-24-07, 06:34 AM
Hey,

You can check out this post I made,
http://forums.whmcs.com/viewtopic.php?t=3150

From,
Adam