Migration guide - MerchantGui

Edit on GitHub

Upgrading from version 2.* to version 3.*

The main update of the MerchantGui v3.0.0 is the ability to edit stores, URLs for the merchant, activate and deactivate merchant.

Other changes are:

  • Removed MerchantCriteriaFilter transfer.
  • Renamed MerchantGuiDependencyProvider::getMerchantProfileFormExpanderPlugins().
Info

Keep in mind that MerchantGui module migration depends on the Merchant module migration.

Info

If your project code contains the MerchantProfile module, you need to remove registered plugins for expanding the form in MerchantGuiDependencyProvider.

To upgrade to the new version of the module, do the following:

  1. Update MerchantGui module version and its dependencies by running the following command:
composer require spryker/merchnat-gui:"^3.0.0" --update-with-dependencies
  1. Update the transfer objects:
console transfer:generate
  1. Generate translator cache by running the following command to get the latest Zed translations:
console translator:generate-cache
  1. Register the following form plugins:
PLUGIN SPECIFICATION PREREQUISITES NAMESPACE
StoreRelationToggleFormTypePlugin Represent store relation toggle form based on stores registered in the system. None \Spryker\Zed\Store\Communication\Plugin\Form
namespace Pyz\Zed\MerchantGui;

use Spryker\Zed\MerchantGui\MerchantGuiDependencyProvider as SprykerMerchantGuiDependencyProvider;
use Spryker\Zed\Store\Communication\Plugin\Form\StoreRelationToggleFormTypePlugin;

class MerchantGuiDependencyProvider extends SprykerMerchantGuiDependencyProvider
{
    /**
     * @return \Spryker\Zed\Kernel\Communication\Form\FormTypeInterface
     */
    protected function getStoreRelationFormTypePlugin(): FormTypeInterface
    {
        return new StoreRelationToggleFormTypePlugin();
    }
}
  1. Generate translator cache by running the following command to get the latest Zed translations:
console translator:generate-cache
  1. Rename method for plugins stack getMerchantProfileFormExpanderPlugins to getMerchantFormExpanderPlugins:
namespace Pyz\Zed\MerchantGui;

use Spryker\Zed\MerchantGui\MerchantGuiDependencyProvider as SprykerMerchantGuiDependencyProvider;
use Spryker\Zed\MerchantProfileGui\Communication\Plugin\MerchantGui\MerchantProfileFormExpanderPlugin;
use Spryker\Zed\MerchantStockGui\Communication\Plugin\MerchantGui\MerchantStockMerchantFormExpanderPlugin;

class MerchantGuiDependencyProvider extends SprykerMerchantGuiDependencyProvider
{
    /**
     * @return \Spryker\Zed\MerchantGuiExtension\Dependency\Plugin\MerchantFormExpanderPluginInterface[]
     */
    protected function getMerchantFormExpanderPlugins(): array
    {
        return [
            new MerchantProfileFormExpanderPlugin(),
            new MerchantStockMerchantFormExpanderPlugin(),
        ];
    }
}
Warning

If your project code contains any changes, make sure that it works correctly.

Estimated migration time: 1-2 hours.

Upgrading from version 1.* to version 2.*

The main update of the MerchantGui v2.0.0 is the ability to expand Table, Form, Tabs for merchant entity. We also removed Merchant delete functionality.

Other changes are:

  • Added the new Merchant fields.
  • Added the unique email and unique merchant reference fields and constraints to Merchant create and edit forms.
  • Added status as a new column to Merchant table.
  • Added Merchant table expander plugins.
  • Added an ability to change Merchant status in the Merchant edit page based on the Merchant available statuses.
Info

Keep in mind that the MerchantGui module makes sense only in connection with modules MerchantGuiExtension and Merchant.

To upgrade to the new version of the module, do the following:

  1. Update the MerchantGui module version and its dependencies by running the following command:
composer require spryker/merchnat-gui:"^2.0.0" --update-with-dependencies
Info

Also, check the Migration Guide for the Merchant.

  1. Update transfer objects:
console transfer:generate
  1. Generate translator cache by running the following command to get the latest Zed translations:
console translator:generate-cache
Warning

If your project code contains any changes for the frontend part, make sure that it works correctly.

  1. If your project has any domain entities, that implement MerchantFormExpanderPluginInterface, MerchantTableActionExpanderPluginInterface, MerchantTableActionExpanderPluginInterface, MerchantTableHeaderExpanderPluginInterface, MerchantTableConfigExpanderPluginInterface, MerchantFormTabExpanderPluginInterface, add the respective plugins to the dependency provider:
class MerchantGuiDependencyProvider extends SprykerMerchantGuiDependencyProvider
{
    /**
     * @return \Spryker\Zed\MerchantGuiExtension\Dependency\Plugin\MerchantFormExpanderPluginInterface[]
     */
    protected function getMerchantProfileFormExpanderPlugins(): array
    {
        return [];
    }

    /**
     * @return \Spryker\Zed\MerchantGuiExtension\Dependency\Plugin\MerchantTableDataExpanderPluginInterface[]
     */
    protected function getMerchantTableDataExpanderPlugins(): array
    {
        return [];
    }

    /**
     * @return \Spryker\Zed\MerchantGuiExtension\Dependency\Plugin\MerchantTableActionExpanderPluginInterface[]
     */
    protected function getMerchantTableActionExpanderPlugins(): array
    {
        return [];
    }

    /**
     * @return \Spryker\Zed\MerchantGuiExtension\Dependency\Plugin\MerchantTableHeaderExpanderPluginInterface[]
     */
    protected function getMerchantTableHeaderExpanderPlugins(): array
    {
        return [];
    }

    /**
     * @return \Spryker\Zed\MerchantGuiExtension\Dependency\Plugin\MerchantTableConfigExpanderPluginInterface[]
     */
    protected function getMerchantTableConfigExpanderPlugins(): array
    {
        return [];
    }

    /**
     * @return \Spryker\Zed\MerchantGuiExtension\Dependency\Plugin\MerchantFormTabExpanderPluginInterface[]
     */
    protected function getMerchantFormTabsExpanderPlugins(): array
    {
        return [];
    }
}
  • MerchantFormTabExpanderPluginInterface plugins are responsible for expanding the tabs in the form.
  • MerchantTableConfigExpanderPluginInterface plugins are responsible for expanding the config data for the table.
  • MerchantTableHeaderExpanderPluginInterface plugins are responsible for expanding the header for the table.
  • MerchantTableActionExpanderPluginInterface plugins are responsible for expanding the action column for the table.
  • MerchantTableDataExpanderPluginInterface plugins are responsible for expanding the data for the table.
  • MerchantFormExpanderPluginInterface plugins are responsible for expanding the form.

Estimated migration time: 1-2 hours.