[ic] Run script after purchase

JT Justman jt-lists at sirius.airdelights.com
Tue Apr 25 11:59:00 EDT 2006

Bob Puff at NLE wrote:
> Hi Gang,
> I've got a cart where -some- items are downloadable products, but not in
> the same manner as the basic IC implementation.  I need to take the list
> of product(s) that are downloadable, and run a script that generates and
> emails a special key to the user.  The key is based on the product they
> purchased, their email address, and a few other parameters.  Obviously,
> this should only run after an order is processed.
> What is a way of hooking into IC to snag this data?  It should probably
> happen between the credit card authorization, and the page displaying
> the successful transaction.  Thanks!
> Bob

Hi, Bob!

You will find that Interchange is very capable of doing something like
this. Since you can alter (nearly) any part of the checkout process, you
can place your code wherever makes the most sense to you. I'll give you
a couple tips to get you started.

* The page that the customer sees after the transaction is
'etc/receipt.html' in most catalogs.
* The customer e-mail receipt is 'etc/mail_receipt'. If you want to send
two separate e-mails, you should be able to figure out how to copy the
[email] tag in there.
* If you want to display information in two places, it is probably a
good idea to run your script and work out the logic of what needs to be
displayed before you reach those two pages. A good place for that is
'etc/log_transaction', which is where the database operations and some
other calculations happen. Store the result in a scratch variable and
then display it wherever you need.

Good luck!


	|Waiting to fix the world since 1995|
"Progress isn't made by early risers. It's made by lazy men trying to
find easier ways to do something."
	- Robert Heinlein

More information about the interchange-users mailing list