Skip to main content

Overview

What is a Response Generator?

A Response Generator transforms the current Shopware cart into the protocol-specific data format that is sent back to the procurement system. It is the bridge between the Shopware data layer (DataFields) and the actual transmission.

GeneratorClassProtocol
OciConnectorResponseGeneratorAgiqonConnector\Connector\System\OCI\ServiceOCI (HTML form)
CxmlConnectorResponseGeneratorAgiqonConnector\Connector\System\Cxml\ServicecXML (XML document)

When is it called?

Point in timeOCIcXML
Rendering the cart pagebuildForm() builds the OCI form data (preview + submit button)generateCxmlPunchOutOrderMessage() generates the PunchOutOrderMessage body
Login responsegeneratePunchoutSetupResponse() returns the StartPage URL

Shared concepts

Fallback chain

For each configured field, the value is determined as follows:

Primary DataField
→ Fallback DataField 1
→ Fallback DataField 2
→ Fallback DataField 3
→ Static value (hardcoded string)
→ empty ("")

As soon as a slot returns a non-empty value, the remaining fallbacks are not evaluated.

Automatic cleanup

All resolved values are automatically cleaned:

  • HTML tags are removed (strip_tags)
  • Whitespace is trimmed from start and end (trim)

LineItemContextResolver

For each cart line item the generator searches all registered LineItemContextResolver instances for the first one whose supports() method returns true. That resolver builds the DataFieldResolutionContext. If no matching resolver is found, the line item is skipped.

→ More: LineItemContextResolver