m-a-x-s-e-e-l-i-g / shopware-6-cart-seeder
A Shopware 6 plugin for seeding shopping carts and customers for development purposes.
Package info
github.com/m-a-x-s-e-e-l-i-g/shopware-6-cart-seeder
Type:shopware-platform-plugin
pkg:composer/m-a-x-s-e-e-l-i-g/shopware-6-cart-seeder
Requires
- php: ~8.3.0
- ext-json: *
- fakerphp/faker: ^1.20
- shopware/core: ^6.6
This package is auto-updated.
Last update: 2026-04-04 15:10:33 UTC
README
A powerful development tool for generating realistic fake customers and shopping carts in Shopware 6.
๐ฏ Purpose
This plugin is designed exclusively for development and testing environments. It provides developers with:
- ๐งโ๐คโ๐ง Realistic Customer Data: Generate customers with proper addresses, payment methods, and profiles
- ๐๏ธ Populated Shopping Carts: Create carts with random products and configurable item counts
- โฐ Aged Cart Simulation: Make carts appear older for testing abandoned cart scenarios
- ๐งน Easy Cleanup: All generated data is marked for simple identification and removal
- ๐ Batch Processing: Generate hundreds or thousands of records with progress tracking
โ ๏ธ Important Warning
๐จ FOR DEVELOPMENT USE ONLY - NEVER USE IN PRODUCTION! ๐จ
This plugin creates fake customer data and should only be used in development/testing environments.
๐ Installation
Method 1: Composer (Recommended)
Install the plugin directly from Packagist:
# Navigate to your Shopware root directory cd /path/to/your/shopware # Install the plugin via Composer composer require m-a-x-s-e-e-l-i-g/shopware-6-cart-seeder
Method 2: Manual Installation
Clone this repository into your Shopware installation's custom/plugins directory:
cd /path/to/your/shopware/custom/plugins git clone <repository-url> shopware-6-cart-seeder
Or download and extract the plugin into custom/plugins/shopware-6-cart-seeder.
Install Dependencies & Activate
# Navigate to your Shopware root directory cd /path/to/your/shopware # Install Faker library (required dependency - only needed for manual installation) # Note: When installing via Composer, dependencies are handled automatically composer require fakerphp/faker # Refresh plugin list bin/console plugin:refresh # Install and activate the plugin bin/console plugin:install --activate MaxSeeligCartSeeder # Clear cache bin/console cache:clear
๐ Usage
Basic Commands
# Generate default amounts (50 customers, 100 carts) bin/console cart-seeder:seed # Generate custom amounts bin/console cart-seeder:seed --customers=100 --carts=200 # Control cart contents bin/console cart-seeder:seed --min-items=2 --max-items=10 # Clean existing test data first bin/console cart-seeder:seed --clean # Complete example with all options bin/console cart-seeder:seed \ --customers=500 \ --carts=1000 \ --min-items=1 \ --max-items=8 \ --clean
Command Options
| Option | Short | Default | Description |
|---|---|---|---|
--customers |
-c |
50 |
Number of fake customers to create |
--carts |
100 |
Number of fake carts to create | |
--min-items |
1 |
Minimum items per cart | |
--max-items |
5 |
Maximum items per cart | |
--clean |
false |
Remove existing seeded data before generating new data |
๐ง Features
๐ฅ Realistic Customer Generation
- Names & Demographics: Uses Faker to generate realistic first/last names
- Contact Information: Unique email addresses and phone numbers
- Addresses: Complete shipping/billing addresses with real-looking street names, cities, and postal codes
- Account Setup: Proper customer groups, payment methods, and salutations
- Identification: All customers get
SEED-prefixed customer numbers for easy cleanup
๐๏ธ Smart Cart Creation
- Product Selection: Randomly selects products from your existing catalog
- Configurable Contents: Control minimum and maximum items per cart
- Realistic Quantities: Random quantities (1-3) per line item
- Aged Carts: Carts are backdated randomly (1-7 days) to simulate real usage patterns
- Customer Assignment: Each cart is linked to a generated customer
๐ Developer-Friendly Features
- Progress Tracking: Visual progress bars for large datasets
- Error Handling: Graceful error handling with detailed error messages
- Memory Efficient: Processes data in batches to avoid memory issues
- Safe Cleanup: Easy identification and removal of test data
๐งน Data Management
Cleanup Generated Data
# Remove all seeded customers and carts bin/console cart-seeder:seed --clean --customers=0 --carts=0 # Or generate fresh data (cleans old data first) bin/console cart-seeder:seed --clean --customers=100 --carts=200
Data Identification
- Customers: All generated customers have customer numbers starting with
SEED- - Carts: Generated carts can be identified by their creation dates and customer associations
- Database Safe: The cleanup process only removes data created by this plugin
๐ Example Output
Cart Seeder - Development Tool
==============================
Cleaning existing seeded data...
โ
Cleaned 45 customers and 89 carts
Generating fake data...
-----------------------
100/100 [โโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 100%
Created 100 fake customers
200/200 [โโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 100%
Created 200 fake carts
โ
Successfully created 100 customers and 200 carts!
๐ ๏ธ Technical Details
Requirements
- Shopware: 6.6 or higher
- PHP: 8.3
- Dependencies:
fakerphp/fakerlibrary - Extensions:
ext-json
Plugin Structure
src/
โโโ MaxSeeligCartSeeder.php # Main plugin class
โโโ Command/
โ โโโ SeedCartsCommand.php # Console command implementation
โโโ Service/
โ โโโ CartSeederService.php # Core seeding logic
โโโ Resources/
โโโ config/
โโโ services.xml # Dependency injection configuration
Performance Considerations
- Memory Usage: For large datasets (1000+ records), ensure adequate PHP memory limit
- Processing Time: Generation time scales with the number of products in your catalog
- Database Load: Consider running during off-peak hours for very large datasets
๐ Use Cases
Development Scenarios
- Feature Testing: Test cart-related functionality with realistic data
- UI/UX Testing: Populate interfaces with varied cart contents
- Performance Testing: Load test shopping cart operations
- Demo Preparation: Create convincing demo data for presentations
Testing Scenarios
- Abandoned Cart Recovery: Test email campaigns and recovery flows
- Customer Segmentation: Test customer grouping and targeting features
- Checkout Flows: Test various cart configurations through checkout
- Analytics: Generate data for testing reporting and analytics features
๐ Best Practices
Recommended Usage
# For development work (small dataset) bin/console cart-seeder:seed --customers=25 --carts=50 # For feature testing (medium dataset) bin/console cart-seeder:seed --customers=100 --carts=200 # For load testing (large dataset) bin/console cart-seeder:seed --customers=500 --carts=1000 # For abandoned cart testing (varied cart ages) bin/console cart-seeder:seed --customers=50 --carts=150 --min-items=1 --max-items=10
Environment Setup
- Use a dedicated development database
- Ensure you have sample products in your catalog
- Set up proper customer groups and payment methods
- Configure adequate PHP memory and execution time limits
๐ค Contributing
Yes! Issues and pull requests are welcome.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Related Resources
โ ๏ธ Remember: This plugin is for development purposes only. Always use a separate development environment and never run this on production data!