Forums / Developer / Shop-Checkout-After trigger
Sergi A
Tuesday 15 June 2010 8:45:39 am
Hello,
I need to create a worflow that would be triggered after purchasing anything on my website. This worflow should create a new node. This new node would store the information about the Basket that the user has purchased, being this information the items purchased.
How can I access the basket information on the workflow? Is it available on the process argument of the execute funcion of the new eZWorkflowEventType extended class ?
function execute( &$process, &$event ) { //Get the Basket items and create a new object with ezContentFunctions::createAndPublish() ...}
Carlos Revillo
Tuesday 15 June 2010 11:24:58 am
have you tried...
eZBasket::currentBasket();
?
Since there, you can get all the info about the basket.
H-Works Agency
Friday 25 February 2011 3:59:01 am
When does "checkout-after" trigger is supposed to execute the workflow code ?
When i try to add a workflow on that trigger its never executed.
Is it in kernel/shop/checkout.php ?
I identified that trigger "checkout->after" is only executed at this line in kernel/shop/checkout :
$operationResult = eZOperationHandler::execute( 'shop', 'checkout', array( 'order_id' => $orderID) ) ;
The problem is : This line is in a "if" statement testing if order is temporary or not (= accepted or not) thus "checkout->after" is never triggered if the order has been accepted.
It looks like a serious misconception has its not possible in Exponential to create a workflow to manage stock for example when an order is accepted.
EZP is Great