Skip to content

Cart Process

You are viewing the next version (v6.7) of the documentation.
Click here to switch to the stable version (v6.6), or use the version switcher on the left to navigate between versions.

Cart Process

  • Within \Shopware\Core\Checkout\Cart\CartProcessorInterface::process, no queries may be executed because this method is executed several times in a row to resolve the dependencies of the elements in the shopping cart.
  • The \Shopware\Core\Checkout\Cart\CartDataCollectorInterface::collect method must always check if the required data has already been loaded. This is to avoid having to execute unnecessarily many queries on the database. The loaded data will be appended to the passed CartDataCollection.
  • The creation of line items must always take place via a LineItemFactoryHandler class.
  • All price calculations must take place via an appropriate PriceCalculator. All price calculators are stored inside the Shopware\Core\Checkout\Cart\Price class.
  • All shopping cart functions must be mapped via a corresponding store API route. The routes are located in the Shopware\Core\Checkout\Cart\SalesChannel namespace.