swissup / core
Swissup core module. It's purpose is to add menu and config placeholders
Installs: 9 964
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 8
Forks: 0
Open Issues: 0
Type:metapackage
pkg:composer/swissup/core
Requires
- swissup/module-core: ^1.12.24
- dev-master
- 1.12.24
- 1.12.23
- 1.12.22
- 1.12.21
- 1.12.20
- 1.12.19
- 1.12.18
- 1.12.17
- 1.12.16
- 1.12.15
- 1.12.14
- 1.12.13
- 1.12.12
- 1.12.11
- 1.12.10
- 1.12.9
- 1.12.8
- 1.12.7
- 1.12.6
- 1.12.5
- 1.12.4
- 1.12.3
- 1.12.2
- 1.12.1
- 1.12.0
- 1.11.1
- 1.11.0
- 1.10.5
- 1.10.4
- 1.10.3
- 1.10.2
- 1.10.1
- 1.10.0
- 1.9.0
- 1.8.7
- 1.8.6
- 1.8.5
- 1.8.4
- 1.8.1
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
This package is auto-updated.
Last update: 2025-10-21 12:43:54 UTC
README
Contents
Installation
cd <magento_root> composer require swissup/core bin/magento module:enable Swissup_Core bin/magento setup:upgrade
Swissup Installer Usage
Swissup installer is a class that collects Swissup Upgrades from all module dependencies and run them, if needed.
Lets see the example of how the Argento theme installer is working:
$module = $this->_objectManager->create('Swissup\Core\Model\Module'); $module->load('Swissup_ArgentoDefault') ->setNewStores([0]) ->up();
What does this code do?
- Create
Swissup\Core\Model\Moduleobject. - Load module info for
Swissup_ArgentoDefaultmodule fromcomposer.jsonfile. - Set the store to use (All Stores).
- Run installer:
- Search for Swissup\Upgrade classes for all
depends of
Swissup_ArgentoDefaultmodule. - Run
getOperationsandupcommand for each of the found upgrade class. - Run
getOperationsandupcommand ofSwissup_ArgentoDefaultupgrade class.
- Search for Swissup\Upgrade classes for all
depends of
Swissup Upgrade Class
When module or theme needs to run some extra logic for specified store views,
it's very handy to use Swissup\Upgrade class, which allows to create and
automatically backup various content types and configuration.
Why not to use Magento DataUpgrade?
- It does not allow to run upgrade multiple times (reinstall)
- It does not have built-in methods to change store configuration
- It does not support content backups
Swissup upgrades — are migrations, located at <module_dir>/Upgrades directory.
Upgrade class must implement Swissup\Core\Api\Data\ModuleUpgradeInterface.
Upgrade examples:
Swissup/ArgentoDefault/Upgrades/1.0.0_initial_installation.php
Swissup/ArgentoDefault/Upgrades/1.0.1_add_callout_blocks.php
Swissup/ArgentoDefault/Upgrades/1.1.0_create_featured_products.php
Upgrade naming conventions
1.0.0 _ initial_installation .php
^ version ^ Separator ^ ClassName ^ file extension
Class example:
<?php namespace Swissup\ArgentoDefault\Upgrades; class InitialInstallation extends \Swissup\Core\Model\Module\Upgrade { public function up() { // This method is optional. // Additional logic may be placed here. } public function getCommands() { return [ 'Configuration' => [ 'prolabels/on_sale/product/active' => 1, 'prolabels/on_sale/category/active' => 1, 'prolabels/is_new/product/active' => 1, 'prolabels/is_new/category/active' => 1, ], 'CmsBlock' => [ 'header_callout' => [ 'title' => 'header_callout', 'identifier' => 'header_callout', 'is_active' => 1, 'content' => 'content' ] ] 'ProductAttribute' => [ [ 'attribute_code' => 'featured', 'frontend_label' => array('Featured'), 'default_value' => 0 ] ], 'Products' => [ 'featured' => 6, 'news_from_date' => 6 ] ]; } }
Supported Commands
| Key/ClassName | Description |
|---|---|
| Configuration | Update store configuration |
| CmsBlock | Create/backup cms blocks |
| CmsPage | Create/backup cms pages |
| Easyslide | Create slider if it does not exists |
| ProductAttribute | Create attribute if it does not exists |
| Easybanner | Create placeholders and banners |
| Products | Create featured, new, special, and any other products |
Popup Message Manager
Popup message manager allows to show regular Magento messages with additional information in popup window.
Usage example
Inject \Swissup\Helper\PopupMessageManager component into your controller
action and use it instead of built-in \Magento\Framework\Message\Manager:
$this->popupMessageManager->addError( __('Decoding failed: Syntax error'), $popupText, $popupTitle );
