Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,110 of 9,110 pages
About the help in other languages
All help pages

Workflows on shop triggers

Which workflow events belong on which shop trigger in Exponential, how to set up the shipping and payment workflows step by step, what an event on each trigger can and cannot do, and the mistakes that break a checkout.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/e-commerce/checkout/workflows-on-shop-triggers.md

On this page

Workflows on shop triggers

This page is for developers and administrators who connect workflows to the shop. It maps each shop trigger to the events that fit there, walks through setting up the usual two workflows, and lists the mistakes that break a checkout.

Contents

  1. The trigger map
  2. Set up the shipping workflow
  3. Set up the payment workflow
  4. Several events on one trigger
  5. Events of your own
  6. Mistakes that break a checkout

The trigger map

Trigger in Setup > TriggersOperation pointWhat exists at that momentFits
shop addtobasket beforepre_addtobasketThe product (object_id), chosen options, quantityRefusing an item (for example a product that may not be sold to this customer)
shop addtobasket afterpost_addtobasketThe item is in the basketLogging, recommendations
shop updatebasket before / afterpre_updatebasket, post_updatebasketItem ids and countsQuantity limits
shop confirmorder beforepre_confirmorderThe temporary orderShipping (ezsimpleshipping or your own event), surcharges as order items
shop checkout beforepre_checkoutThe temporary order with its final totalPayment (ezpaymentgateway)
shop checkout afterpost_checkoutThe placed order with its number; the mail has been sentReporting, exports to other systems, analytics

Which triggers appear at all is decided by workflow.ini [OperationSettings] (workflow.ini for the shop). Which event types may be put on a trigger is decided by each event type: ezsimpleshipping only allows shop confirmorder before.

Set up the shipping workflow

  1. Set the amount: ShippingCost and ShippingDescription in settings/override/workflow.ini.append.php.
  2. Setup > Workflows, open a group, New workflow, name it "Shipping".
  3. Add the event Simple shipping, save.
  4. Setup > Triggers: for shop confirmorder before, choose "Shipping", save.
  5. Place a test order: the confirmation page shows the shipping line.

Details and limits: Simple shipping event.

Set up the payment workflow

  1. Activate the gateway extension and set its provider file to test mode (paymentgateways.ini walkthrough).
  2. Setup > Workflows, New workflow, name it "Payment".
  3. Add the event Payment Gateway; in the event, select the gateways customers may use; save.
  4. Setup > Triggers: for shop checkout before, choose "Payment", save.
  5. Place a test order and complete the payment in the provider's test mode.

Details: Payment gateway event.

Several events on one trigger

A trigger has one workflow. To run several events at one point, add them to that workflow in order. Events run one after the other; the next starts only when the previous accepted. On pre_checkout, put checks that may refuse an order before the payment event, so that a customer is never charged for an order that a later event refuses.

To run an event only for some customers or products, wrap a second workflow in a multiplexer event (Multiplexer in the shop).

Events of your own

An event type is a class extending eZWorkflowEventType with an execute() method that returns a status: accepted, rejected, show a template, redirect, or defer to cron. Generate one with Setup > RAD's workflow event wizard (setup/workflowevent) and read Writing a workflow event type. Restrict it to the triggers it understands with setTriggerTypes(), as eZSimpleShippingType does.

For an event on post_checkout, the process parameters carry order_id; fetch the order with eZOrder::fetch() and read its number, items and totals. Never read card data: there is none to read, and there must not be.

Mistakes that break a checkout

MistakeSymptom
Payment event on checkout after instead of beforeOrders are placed and mailed before anyone pays
Shipping event on checkout beforeNo shipping on the confirmation page; total changes after confirming
Simple shipping event and a shipping handler both activeTwo independent shipping charges can appear; use one or the other
Workflow edited but not savedOld behavior continues; check Setup > Triggers
workflow.php cron part not runningDeferred processes never resume (Workflows)
No payment workflow at allEvery order is placed unpaid; the dashboard's "Next steps" warns about it

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x