# swissup/module-theme-store-views

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

`composer require swissup/module-theme-store-views`

Canonical URL: https://packagento.com/swissup/module-theme-store-views

## At a glance

- **Vendor**: swissup (https://packagento.com/swissup.md)
- **Latest version**: 1.0.4 — released 2026-05-15
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/swissup/module-theme-store-views and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require swissup/module-theme-store-views:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

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

## README

[![Latest Stable Version](https://poser.pugx.org/swissup/module-theme-store-views/v/stable)](https://packagist.org/packages/swissup/module-theme-store-views)
[![Total Downloads](https://poser.pugx.org/swissup/module-theme-store-views/downloads)](https://packagist.org/packages/swissup/module-theme-store-views)
[![License](https://poser.pugx.org/swissup/module-theme-store-views/license)](https://packagist.org/packages/swissup/module-theme-store-views)
[![PHP Version](https://img.shields.io/badge/php-7.4%2B%20%7C%208.x-blue)](https://packagist.org/packages/swissup/module-theme-store-views)
[![Magento](https://img.shields.io/badge/magento-2.4.x-orange)](https://packagist.org/packages/swissup/module-theme-store-views)

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)

```bash
## 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:

```bash
## 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:

```bash
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

```bash
## 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

_(README truncated for .md surface. Full README on https://packagento.com/swissup/module-theme-store-views.)_

## Changelog

All notable changes to the Swissup Theme Store Views module will be documented in this file.

### [1.0.2] - 2025-01-08

#### Enhanced
- **🎨 CLI Output**: Complete visual overhaul with colorful, professional output
- **📊 Progress Tracking**: Real-time progress bar showing processed themes count
- **📈 Live Statistics**: Display of created and skipped store counts during processing
- **🌈 Color Coding**: Green for success, yellow for warnings, red for errors
- **📋 Professional Headers**: Styled banners and boxed sections
- **⚡ Status Messages**: Clear progress indicators with emojis and colors
- **📦 Installation Feedback**: Enhanced installer output with better formatting
- **🎯 Command Execution**: Improved command output with colored formatting
- **🏁 Summary Report**: Detailed completion summary with statistics

#### Technical Improvements
- Enhanced progress bar with custom formatting and live message updates
- Improved installer output clearing for better display
- Better error handling and user feedback
- Real-time counter updates throughout the process

### [1.0.1] - 2025-01-08

#### Fixed
- Updated composer.json configuration for proper package management
- Resolved module installation path conflicts
- Improved documentation and validation scripts

#### Added
- Enhanced package validation script
- Professional README with badges
- Complete GitHub integration templates

### [1.0.0] - 2025-01-08

#### Added
- Initial release of Swissup Theme Store Views module
- Automatic store view creation for 18 Swissup themes
- Theme application to corresponding store views
- Integration with Swissup Marketplace installer system
- Support for `etc/marketplace/installer.xml` processing
- Automatic installation of theme content (CMS pages, blocks, sliders, etc.)
- `--reinstall` option to force reinstall on existing store views
- Progress bars and detailed output for user feedback
- Automatic maintenance tasks (setup:upgrade, reindex, cache clear)
- Error handling and validation
- Non-interactive execution with proper store context

#### Features
- **Command**: `swissup:theme:create-storeviews`
- **Options**: `--reinstall` (`-r`)
- **Supported Themes**: All 18 major Swissup themes
- **Auto-detection**: Finds installers in both vendor/ and app/design/ directories
- **Safety**: Skips existing store views unless forced
- **Maintenance**: Complete setup upgrade and reindexing

#### Technical Details
- Compatible with Magento 2.4.x
- Uses proper Magento APIs for store creation
- Integrates with Swissup Marketplace commands
- Memory-safe execution with unlimited memory for heavy operations
- Proper dependency injection and command registration

## Recent Versions

| Version | Released |
|---|---|
| 1.0.4 | 2026-05-15 |
| 1.0.3 | 2025-12-05 |
| 1.0.2 | 2025-07-08 |
| 1.0.1 | 2025-07-08 |
| 1.0.0 | 2025-07-08 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| swissup/module-marketplace | ^1.9 |

### Suggest

| Package | Constraint |
|---|---|
| swissup/theme-frontend-absolute | Swissup Absolute theme |
| swissup/theme-frontend-argento-blank | Swissup Argento Blank theme |
| swissup/theme-frontend-argento-essence | Swissup Argento Essence theme |
| swissup/theme-frontend-argento-flat | Swissup Argento Flat theme |
| swissup/theme-frontend-argento-force | Swissup Argento Force theme |
| swissup/theme-frontend-argento-home | Swissup Argento Home theme |
| swissup/theme-frontend-argento-luxury | Swissup Argento Luxury theme |
| swissup/theme-frontend-argento-mall | Swissup Argento Mall theme |
| swissup/theme-frontend-argento-marketplace | Swissup Argento Marketplace theme |
| swissup/theme-frontend-argento-pure2 | Swissup Argento Pure2 theme |
| swissup/theme-frontend-argento-stripes | Swissup Argento Stripes theme |
| swissup/theme-frontend-argentobreeze-blank | Swissup Argento Breeze Blank theme |
| swissup/theme-frontend-argentobreeze-business | Swissup Argento Breeze Business theme |
| swissup/theme-frontend-argentobreeze-chic | Swissup Argento Breeze Chic theme |
| swissup/theme-frontend-argentobreeze-force | Swissup Argento Breeze Force theme |
| swissup/theme-frontend-argentobreeze-stripes | Swissup Argento Breeze Stripes theme |
| swissup/theme-frontend-breeze-blank | Swissup Breeze Blank theme |
| swissup/theme-frontend-breeze-evolution | Swissup Breeze Evolution theme |

## Quality

Latest release (1.0.4) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Fail | 95 | 33 errors, 62 warnings (ruleset: Magento2) — 30 auto-fixable with phpcbf |
| PHPMD | Warning | 1 | 1 rule violation (ExcessiveMethodLength:1) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 121 | 121 | – | – |
| 2.4.8 | – | 120 | 120 | – |
| 2.4.9 | – | – | 120 | 120 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Error | 0 | composer audit produced unparseable output (exit=100) |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["swissup/module-theme-store-views"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

swissup is a Magento 2 vendor on Packagento. See https://packagento.com/swissup.md for their full catalogue.

