2017 © Pedro Peláez
 

magento2-module core

Swissup core module. It's purpose is to add menu and config placeholders

image

swissup/core

Swissup core module. It's purpose is to add menu and config placeholders

  • Tuesday, July 24, 2018
  • by vovayatsyuk
  • Repository
  • 5 Watchers
  • 4 Stars
  • 3,166 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 24 Versions
  • 22 % Grown

The README.md

Core

Contents

  1. Installation
  2. Swissup Installer Usage
  3. Swissup Upgrade Class
  4. Popup Message Manager

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., (*1)

Lets see the example of how the Argento theme installer is working:, (*2)

$module = $this->_objectManager->create('Swissup\Core\Model\Module');
$module->load('Swissup_ArgentoDefault')
    ->setNewStores([0])
    ->up();

What does this code do?, (*3)

  1. Create Swissup\Core\Model\Module object.
  2. Load module info for Swissup_ArgentoDefault module from composer.json file.
  3. Set the store to use (All Stores).
  4. Run installer:
    1. Search for Swissup\Upgrade classes for all depends of Swissup_ArgentoDefault module.
    2. Run getOperations and up command for each of the found upgrade class.
    3. Run getOperations and up command of Swissup_ArgentoDefault upgrade class.

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., (*4)

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, (*5)

Swissup upgrades — are migrations, located at <module_dir>/Upgrades directory. Upgrade class must implement Swissup\Core\Api\Data\ModuleUpgradeInterface., (*6)

Upgrade examples:, (*7)

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, (*8)

1.0.0       _               initial_installation   .php
^ version   ^ Separator     ^ ClassName            ^ file extension

Class example:, (*9)

<?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, (*10)

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 allows to show regular Magento messages with additional information in popup window., (*11)

Popup Message Example, (*12)

Usage example, (*13)

Inject \Swissup\Helper\PopupMessageManager component into your controller action and use it instead of built-in \Magento\Framework\Message\Manager:, (*14)

$this->popupMessageManager->addError(
    __('Decoding failed: Syntax error'),
    $popupText,
    $popupTitle
);

The Versions

24/07 2018

dev-master

9999999-dev

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

core installer notifier module manager swissup services popup messenger

24/07 2018

1.6.2

1.6.2.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

core installer notifier module manager swissup services popup messenger

23/04 2018

1.6.1

1.6.1.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

core installer notifier module manager swissup services popup messenger

16/03 2018

1.6.0

1.6.0.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

core installer notifier module manager swissup services popup messenger

28/02 2018

1.5.0

1.5.0.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

core installer notifier module manager swissup services popup messenger

22/09 2017

1.4.9

1.4.9.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

core installer notifier module manager swissup services popup messenger

21/08 2017

1.4.8

1.4.8.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

core installer notifier module manager swissup services popup messenger

14/06 2017

1.4.7

1.4.7.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

core installer notifier module manager swissup services popup messenger

25/05 2017

1.4.6

1.4.6.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

core installer notifier module manager swissup services popup messenger

31/03 2017

1.4.5

1.4.5.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

core installer notifier module manager swissup services popup messenger

27/02 2017

1.4.4

1.4.4.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

core installer notifier module manager swissup services popup messenger

13/01 2017

1.4.3

1.4.3.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

core installer notifier module manager swissup services popup messenger

28/11 2016

1.4.2

1.4.2.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

core installer notifier module manager swissup services popup messenger

14/11 2016

1.4.1

1.4.1.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

core installer notifier module manager swissup services popup messenger

30/09 2016

1.4.0

1.4.0.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

core installer notifier module manager swissup services popup messenger

20/09 2016

1.3.1

1.3.1.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

core installer notifier module manager swissup services popup messenger

02/08 2016

1.3.0.2

1.3.0.2

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

core installer notifier module manager swissup services popup messenger

08/07 2016

1.3.0.1

1.3.0.1

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

core installer notifier module manager swissup services popup messenger

24/06 2016

1.3.0

1.3.0.0

Swissup core module. It's purpose is to add menu and config placeholders

  Sources   Download

OSL-3.0

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

core installer notifier module manager swissup services popup messenger

26/05 2016

1.2.3

1.2.3.0

Swissup core module. Add menu and config placeholders

  Sources   Download

OSL-3.0

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

core installer notifier module manager swissup services popup messenger

19/05 2016

1.2.2

1.2.2.0

Swissup module manager. Module installer. Popup message manager.

  Sources   Download

OSL-3.0

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

14/04 2016

1.0.2

1.0.2.0

N/A

  Sources   Download

OSL-3.0

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

01/04 2016

1.0.1

1.0.1.0

N/A

  Sources   Download

OSL-3.0

The Requires

  • php ~5.5.0|~5.6.0|~7.0.0

 

18/02 2016

1.0.0

1.0.0.0

N/A

  Sources   Download

OSL-3.0

The Requires

  • php ~5.5.0|~5.6.0