Shop-Checkout-After trigger

Author Message

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

Hello,

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 ezpublish to create a workflow to manage stock for example when an order is accepted.

EZP is Great

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:07:04
Script start
Timing: Jan 18 2025 02:07:04
Module start 'layout'
Timing: Jan 18 2025 02:07:04
Module start 'content'
Timing: Jan 18 2025 02:07:06
Module end 'content'
Timing: Jan 18 2025 02:07:06
Script end

Main resources:

Total runtime1.5351 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.0313152.6250
Module start 'layout' 0.00560.0033 741.656339.4453
Module start 'content' 0.00881.5248 781.1016566.5781
Module end 'content' 1.53360.0014 1,347.679712.1641
Script end 1.5351  1,359.8438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2214160.0002
Check MTime0.00140.0887160.0001
Mysql Total
Database connection0.00070.048010.0007
Mysqli_queries1.484896.7231590.0252
Looping result0.00070.0460570.0000
Template Total1.495397.420.7476
Template load0.00200.132320.0010
Template processing1.493397.273920.7466
Template load and register function0.00020.014310.0002
states
state_id_array0.00210.135010.0021
state_identifier_array0.00340.223220.0017
Override
Cache load0.00170.1095220.0001
Sytem overhead
Fetch class attribute can translate value0.00080.052330.0003
Fetch class attribute name0.00150.095040.0004
XML
Image XML parsing0.00070.044830.0002
class_abstraction
Instantiating content class attribute0.00000.000640.0000
General
dbfile0.00090.0588170.0001
String conversion0.00000.000540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs