[TYPO3-shop] hook during order processing
Simon Tuck
e-mailNO at SPAMeyejet.com
Sat Feb 25 11:54:42 CET 2006
Vikram Mandal wrote:
> Hi,
>
> I need to call a function when an order is placed.. the basket content
> should also be available to my function. I came across this code in the
> class.tx_ttproducts_finalize_div.php:
>
> // This cObject may be used to call a function which clears
> settings in an external order system.
> // The output is NOT included anywhere
> $pibase->getExternalCObject('externalFinalizing');
>
>
> Can someone please guide me if this is the correct function and how do I
> use it?
>
> And pointer to docs will also be very helpful.
>
> Regards,
> Vikram Mandal
Hi Vikram,
I was wondering what that does as well. As far as I could tell it will call cObjGetSingle with the current instance of tslib_cObj. i.e. you can
create a custom content object that is then processed just like any other cObj (IMAGE, TEXT, USER etc.) with the current data array (presumably
the tt_products records in the basket).
You can set it via TS, for example:
plugin.tt_products.externalProcessing = TEXT
plugin.tt_products.externalProcessing.value = hello world
This would be output in the shopping basket where the appropriate marker is set. The example doesn't make much sense, rather I expect you'd be
using a cObject 'USER'.
There are two other cObjects that you can define. 'externalFinalizing' and 'externalProcessing_final'. To process your record array *after* the
order has been sent you could do:
includeLibs.externalFinalizing = my/own/script.php
plugin.tt_products.externalFinalizing = USER
plugin.tt_products.externalFinalizing.userFunc = user_externalFinalizing -> myMethod
I never tried it but that's my best guess. I'd be interested to hear how it works if you decide to try it out...
Cheers,
Simon
PS. the doc is here:
http://typo3.org/documentation/document-library/extension-manuals/tt_products/current/view/1/5/
For help on USER and USER_INT refer to:
http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/8/22/
More information about the TYPO3-project-tt-products
mailing list