protected function getStockItems( array $productCodes )
	{
		$context = $this->getContext();

		/** client/html/catalog/stock/sort
		 * Sortation key if stock levels for different types exist
		 *
		 * Products can be shipped from several warehouses with a different
		 * stock level for each one. The stock levels for each warehouse will
		 * be shown in the product detail page. To get a consistent sortation
		 * of this list, the configured key will be used by the stock manager.
		 *
		 * Possible keys for sorting are ("-stock.type" for descending order):
		 * * stock.productcode
		 * * stock.stocklevel
		 * * stock.type
		 * * stock.dateback
		 *
		 * @param array List of key/value pairs for sorting
		 * @since 2017.01
		 * @category Developer
		 * @see client/html/catalog/stock/level/low
		 */
		$sort = $context->getConfig()->get( 'client/html/catalog/stock/sort', 'stock.type' );
		$type = $context->getLocale()->getSite()->getConfigValue( 'stocktype' );

		return \Aimeos\Controller\Frontend::create( $context, 'stock' )
			->code( $productCodes )->type( $type )->sort( $sort )
			->slice( 0, count( $productCodes ) )
			->search();
	}