Jump to content

On checkout


tj

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

  • WHMCS CEO

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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