Add cart middleware.