swissup/module-theme-store-views

Magento 2 module that automatically creates store views for each Swissup theme and applies corresponding themes with full installation

1.0.2 2025-07-08 17:20 UTC

This package is auto-updated.

Last update: 2025-07-08 17:21:13 UTC


README

Latest Stable Version Total Downloads License PHP Version Magento

A Magento 2 module that automatically creates store views for each Swissup theme and applies the corresponding theme to them, including running theme-specific installers.

๐ŸŽฏ What it does

This module streamlines the process of setting up multiple Swissup themes by:

  • Creating store views for each available Swissup theme
  • Applying themes automatically to their corresponding store views
  • Running theme installers to install CMS content, blocks, sliders, and configurations
  • Performing maintenance tasks like setup upgrade and reindexing

๐Ÿ“‹ Requirements

  • Magento 2.4+ (tested on 2.4.x)
  • Swissup themes installed via Composer
  • PHP 7.4+ or 8.x
  • Swissup Marketplace module

๐Ÿš€ Installation

Method 1: Composer (Recommended)

# Install via Composer
composer require swissup/module-theme-store-views

# Enable the module
php bin/magento module:enable Swissup_ThemeStoreViews

# Run setup upgrade
php bin/magento setup:upgrade

# Clear cache and compile
php bin/magento cache:flush
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Method 2: Manual Installation

  1. Download or clone this repository
  2. Copy the module to app/code/Swissup/ThemeStoreViews/
  3. Run the following commands:
# Enable the module
php bin/magento module:enable Swissup_ThemeStoreViews

# Run setup upgrade
php bin/magento setup:upgrade

# Clear cache
php bin/magento cache:flush

๐Ÿ“– Usage

Basic Command

Create store views for all Swissup themes:

php bin/magento swissup:theme:create-storeviews

Command Options

Option Short Description
--reinstall -r Run theme installers even for existing store views
--help -h Display help information

Examples

# Create store views (skips existing ones)
php bin/magento swissup:theme:create-storeviews

# Force reinstall themes for all store views
php bin/magento swissup:theme:create-storeviews --reinstall

# Show help
php bin/magento swissup:theme:create-storeviews --help

๐ŸŽจ Supported Themes

The module automatically detects and processes these Swissup themes:

Theme Store View Code Store View Name
Swissup/absolute absolute Absolute
Swissup/argento-blank argento_blank Argento Blank
Swissup/argento-essence argento_essence Argento Essence
Swissup/argento-flat argento_flat Argento Flat
Swissup/argento-force argento_force Argento Force
Swissup/argento-home argento_home Argento Home
Swissup/argento-luxury argento_luxury Argento Luxury
Swissup/argento-mall argento_mall Argento Mall
Swissup/argento-marketplace argento_marketplace Argento Marketplace
Swissup/argento-pure2 argento_pure2 Argento Pure2
Swissup/argento-stripes argento_stripes Argento Stripes
Swissup/argentobreeze-blank argentobreeze_blank Argento Breeze Blank
Swissup/argentobreeze-business argentobreeze_business Argento Breeze Business
Swissup/argentobreeze-chic argentobreeze_chic Argento Breeze Chic
Swissup/argentobreeze-force argentobreeze_force Argento Breeze Force
Swissup/argentobreeze-stripes argentobreeze_stripes Argento Breeze Stripes
Swissup/breeze-blank breeze_blank Breeze Blank
Swissup/breeze-evolution breeze_evolution Breeze Evolution

โšก Features

๐Ÿช Store View Creation

  • Automatically generates valid store view codes
  • Uses theme titles as store view names
  • Assigns to default website and store group
  • Sets appropriate sort order and status

๐ŸŽจ Theme Application

  • Applies the correct theme to each store view
  • Updates design configuration automatically
  • Maintains theme-store view relationships

๐Ÿ“ฆ Theme Installation

  • Detects etc/marketplace/installer.xml files
  • Runs Swissup Marketplace installers automatically
  • Installs theme-specific content:
    • CMS Pages
    • CMS Blocks
    • Sliders (EasySlider)
    • Product Attributes
    • Configuration Settings
    • Media Files
    • Product Collections

๐Ÿ”ง Maintenance Tasks

  • Runs setup:upgrade --safe-mode=1
  • Executes indexer:reindex
  • Clears all cache types
  • Provides progress feedback

๐Ÿ›ก๏ธ Safety Features

  • Skips existing store views by default
  • Non-interactive execution
  • Error handling and validation
  • Progress bars and status updates

๐ŸŽจ Enhanced CLI Experience (v1.0.2+)

  • Professional Output: Colorful, styled headers with box borders
  • Real-time Progress: Live progress bar showing current theme and statistics
  • Color-coded Status: Green for success, yellow for warnings, red for errors
  • Live Statistics: Current counts of created and skipped stores
  • Professional Summary: Detailed completion report with statistics
  • Step-by-step Feedback: Clear indicators for each post-processing step
  • Enhanced Error Messages: Clear, colorful error reporting
  • Emoji Indicators: Visual cues for different types of operations

๐Ÿ” How It Works

  1. Discovery: Scans for installed Swissup themes
  2. Validation: Checks if themes exist and are properly installed
  3. Store Creation: Creates store views with proper codes and names
  4. Theme Application: Assigns themes to their respective store views
  5. Content Installation: Runs marketplace installers for theme content
  6. Maintenance: Performs setup upgrade, reindexing, and cache clearing

๐Ÿ“ Module Structure

app/code/Swissup/ThemeStoreViews/
โ”œโ”€โ”€ Console/
โ”‚   โ””โ”€โ”€ Command/
โ”‚       โ””โ”€โ”€ CreateThemeStoreViews.php    # Main command class
โ”œโ”€โ”€ etc/
โ”‚   โ”œโ”€โ”€ di.xml                           # Dependency injection
โ”‚   โ””โ”€โ”€ module.xml                       # Module configuration
โ”œโ”€โ”€ registration.php                     # Module registration
โ””โ”€โ”€ README.md                           # This documentation

๐Ÿ› Troubleshooting

Store View Already Exists

Issue: Store view with the same code already exists Solution: Use --reinstall flag to run installers on existing store views

php bin/magento swissup:theme:create-storeviews --reinstall

Theme Not Found

Issue: Theme not detected by the module Solution: Ensure the theme is properly installed and appears in:

php bin/magento theme:info

Installer Not Found

Issue: No installer.xml found for a theme Solution: This is normal - not all themes have installers. The module will skip installation for themes without etc/marketplace/installer.xml

Permission Issues

Issue: File permission errors during installation Solution: Ensure proper file permissions:

chmod -R 755 var/
chmod -R 755 pub/static/
chmod -R 755 pub/media/

Memory Issues

Issue: PHP memory limit exceeded Solution: The module automatically uses unlimited memory for heavy operations

๐Ÿ“Š Output Example

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                    ๐ŸŽจ Swissup Theme Store Views Creator                           โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿš€ Starting theme store views creation process...
๐Ÿ“Š Website: Main Website (ID: 1)
๐Ÿช Store Group: Main Website Store (ID: 1)

๐Ÿ“‹ Processing 18 themes...
10/18 [===============>------------]  55% Processing: Swissup/argento-pure2 (10/18) | Created: 8 | Skipped: 2

๐Ÿ”ง Found installer for theme: Argento Pure2
๐Ÿ“ฆ Installing package: swissup/theme-frontend-argento-pure2
๐Ÿ’ป Executing: php bin/magento marketplace:package:install swissup/theme-frontend-argento-pure2 --store=27 --no-interaction
[notice] Processing swissup/theme-frontend-argento-pure2
[info] Config: Update store parameters
[info] Cms Pages: Backup existing pages
[info] CMS PAGES: Create new pages
[info] Cms Blocks: Backup existing and create new blocks
โœ… Command completed!

โœ… Created store view: Argento Pure2 (argento_pure2)

18/18 [============================] 100% Complete (18/18) | Created: 16 | Skipped: 2

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                            ๐Ÿ“Š SUMMARY REPORT                               โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘ โœ… Created:  16 store views                                                  โ•‘
โ•‘ โญ๏ธ  Skipped:   2 existing ones                                               โ•‘
โ•‘ ๐Ÿ“‹ Total:    18 themes processed                                            โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿ”ง Post-processing steps: Running required maintenance tasks...

๐Ÿš€ Step 1/3: Running setup:upgrade...
๐Ÿ” Step 2/3: Running reindex...
๐Ÿงน Step 3/3: Clearing cache...
โœ… Cache cleared successfully!

๐ŸŽ‰ SUCCESS! Theme store views setup completed successfully!
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                        ๐ŸŒŸ PROCESS COMPLETE ๐ŸŒŸ                              โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿ”— Related Commands

# List all store views
php bin/magento store:list

# Check theme installation
php bin/magento theme:info

# Manual marketplace installation
php bin/magento marketplace:package:install swissup/theme-frontend-[theme-name] --store=[store-id]

# Manual setup and maintenance
php bin/magento setup:upgrade --safe-mode=1
php bin/magento indexer:reindex
php bin/magento cache:flush

๐Ÿ“„ License

This module follows the same license as your Magento installation and Swissup modules.

๐Ÿ’ฌ Support

For issues related to:

Version: 1.0.2
Compatible: Magento 2.4.x
Created: 2025