SOURCING & BACKGROUND_SEARCH
SOURCING
Class: OciSourcingController
Purpose: Redirects the buyer to the Shopware search results page with the provided search term. The buyer stays logged in and can browse the results normally.
Flow
- Check
searchstringparameter (required) - Apply
urldecode()to the search string - Redirect to
frontend.search.pagewith thesearchquery parameter
Parameters
| Parameter | Required | Description |
|---|---|---|
searchstring | ✅ Yes | URL-encoded search term |
Response
HTTP 302 Redirect
Location: /search?search={decodedSearchString}
SOURCING leaves the ConnectorSession active — the buyer can add items from the search results to the cart and continue shopping normally.
BACKGROUND_SEARCH
Class: OciBackgroundSearchController
Purpose: Performs a product search in the background, adds all results to the cart immediately, and returns the complete OCI form. Intended for procurement systems that trigger a silent search and expect all results back as OCI fields.
Flow
- Check
searchstringparameter (required) - Shopware
SearchPageLoader::load()with the search term using$dataFeedContext - Extract
ProductCollectionfrom search results - Add all products via
OciProductService::addProductsToCart()to$cartContext - Build OCI form:
OciConnectorResponseGenerator::buildForm()(using$dataFeedContext) - Clear session
- Render Twig template
Parameters
| Parameter | Required | Description |
|---|---|---|
searchstring | ✅ Yes | URL-encoded search term |
Response
@AgiqonConnector/storefront/plugin/oci-background-search.html.twig
Template variables:
| Variable | Type | Description |
|---|---|---|
ociForm | OciFormData | OCI form with all search result products |
AgiqonOciStartIndex | int | System start index |
BACKGROUND_SEARCH clears the ConnectorSession after the response. DataFields are resolved for all found products — for large result sets this can be resource-intensive.