Skip to main content

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

  1. Check searchstring parameter (required)
  2. Apply urldecode() to the search string
  3. Redirect to frontend.search.page with the search query parameter

Parameters

ParameterRequiredDescription
searchstring✅ YesURL-encoded search term

Response

HTTP 302 Redirect
Location: /search?search={decodedSearchString}
note

SOURCING leaves the ConnectorSession active — the buyer can add items from the search results to the cart and continue shopping normally.


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

  1. Check searchstring parameter (required)
  2. Shopware SearchPageLoader::load() with the search term using $dataFeedContext
  3. Extract ProductCollection from search results
  4. Add all products via OciProductService::addProductsToCart() to $cartContext
  5. Build OCI form: OciConnectorResponseGenerator::buildForm() (using $dataFeedContext)
  6. Clear session
  7. Render Twig template

Parameters

ParameterRequiredDescription
searchstring✅ YesURL-encoded search term

Response

@AgiqonConnector/storefront/plugin/oci-background-search.html.twig

Template variables:

VariableTypeDescription
ociFormOciFormDataOCI form with all search result products
AgiqonOciStartIndexintSystem start index
note

BACKGROUND_SEARCH clears the ConnectorSession after the response. DataFields are resolved for all found products — for large result sets this can be resource-intensive.