SyliusCon 2025
Early Bird Deal
LogoLogo
🛣️ Roadmap💻 Sylius Demo💬 Community Slack
  • Sylius Documentation
  • Sylius Plugins
  • Sylius Stack
  • đź“–Sylius 2.0 Documentation
    • Organization
      • Release Cycle
      • Backwards Compatibility Promise
      • Sylius Team
      • Sylius Roadmap
  • Getting Started with Sylius
    • Installation
    • Basic Configuration
    • Shipping & Payment
    • First Product
    • Customizing the Shop
    • Customizing Business Logic
    • Using API
    • Installing Plugins
    • Deployment
    • Summary
  • The Book
    • Introduction to Sylius
    • Installation
      • System Requirements
      • Sylius CE Installation
        • Sylius CE Installation with Docker
      • âž•Sylius Plus Installation
      • Upgrading Sylius CE
      • Upgrading Sylius Plus
    • Architecture
      • Architecture Overview
      • Architectural Drivers
      • Resource Layer
      • State Machine
      • Translations
      • E-Mails
      • Contact
      • Fixtures
      • Events
    • Configuration
      • Channels
      • Locales
      • Currencies
    • Customers
      • Customer & ShopUser
      • âž•Customer Pools
      • AdminUser
      • Addresses
        • Countries
        • Zones
        • Addresses
        • Address Book
    • Products
      • Products
      • Product Reviews
      • Product Associations
      • Attributes
      • Pricing
      • Catalog Promotions
      • Taxons
      • Inventory
      • âž•Multi-Source Inventory
      • Search
    • Carts & Orders
      • Orders
      • Cart flow
      • Taxation
      • Adjustments
      • Cart Promotions
      • Coupons
      • Payments
      • đź§©Invoices
      • Shipments
    • Support
    • Contributing
      • Contributing Code
        • Submitting a Patch
        • ⚠️Security Issues
        • Coding Standards
        • Conventions
        • Sylius License and Trademark
      • Contributing Translations
      • Key Contributors
  • The Customization Guide
    • Customizing Models
      • How to add a custom model?
      • How to add a custom translatable model?
    • Customizing Forms
      • How to add a live form for a custom model?
    • Customizing Styles
    • Customizing Validation
    • Customizing Menus
    • Customizing Templates
    • Customizing Translations
    • Customizing Flashes
    • Customizing State Machines
    • Customizing Grids
    • Customizing Fixtures
    • Customizing API
    • Customizing Serialization of API
    • Customizing Payments
      • How to integrate a Payment Gateway as a Plugin?
  • 🧑‍🍳The Cookbook
  • How to resize images?
  • How to add one image to an entity?
  • How to add multiple images to an entity?
  • Sylius 1.X Documentation
    • đź““Sylius 1.x Documentation
Powered by GitBook
LogoLogo

Developer

  • Community
  • Online Course

About

  • Team

© 2025 Sylius. All Rights Reserved

On this page

Was this helpful?

Edit on GitHub
  1. The Book
  2. Carts & Orders

Cart flow

Picture this: A user visits your Sylius shop and exclaims, “Someone’s been using my cart! It’s full of items I didn’t add!” Let’s avoid this surprise by exploring how Sylius handles cart functionality.

In Sylius, the cart represents an order in progress that hasn’t been placed yet.

Each visitor in Sylius has a cart. The cart can be cleared in three ways, by: - placing an order - removing items manually - using a cart-clearing command

The cart flow varies depending on whether the user is logged in and what’s already in the cart.

First scenario:

Given there is a not logged in user
And this user adds a blue T-Shirt to the cart
And there is a customer identified by email "[email protected]"
And the "[email protected]" customer has a previously created cart with a red Cap in it
When the not logged in user logs in using "[email protected]" email
Then the cart created by a not logged in user should be dropped
And the cart previously created by the user identified by "[email protected]" should be set as the current one
And the "[email protected]" customer's cart should have a red Cap in it

Second scenario:

Given there is a not logged in user
And this user adds a blue T-Shirt to the cart
And there is a customer identified by email "[email protected]" with an empty cart
When the not logged in user logs in using "[email protected]" email
Then the cart created by a not logged in user should not be dropped
And the "[email protected]" customer's cart should have a blue T-Shirt in it

Third scenario:

Given there is a customer identified by email "[email protected]" with an empty cart
And this user adds a blue T-Shirt to the cart
When the user logs out
And views the cart
Then the cart should be empty

The cart mentioned in the third scenario will be available once the customer logs in again.

PreviousOrdersNextTaxation

Last updated 7 months ago

Was this helpful?