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.
| Generator | Class | Protocol |
|---|---|---|
OciConnectorResponseGenerator | AgiqonConnector\Connector\System\OCI\Service | OCI (HTML form) |
CxmlConnectorResponseGenerator | AgiqonConnector\Connector\System\Cxml\Service | cXML (XML document) |
When is it called?
| Point in time | OCI | cXML |
|---|---|---|
| Rendering the cart page | buildForm() builds the OCI form data (preview + submit button) | generateCxmlPunchOutOrderMessage() generates the PunchOutOrderMessage body |
| Login response | — | generatePunchoutSetupResponse() 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