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.

Maintainers

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

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 1

1.0.1 2025-09-04 12:47 UTC

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.

Shopware 6 Plugin Version License PHP

image

๐ŸŽฏ 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/faker library
  • 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

  1. Use a dedicated development database
  2. Ensure you have sample products in your catalog
  3. Set up proper customer groups and payment methods
  4. 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!