Merchant Portal - Marketplace Product + Tax feature integration

Edit on GitHub

This document describes how to integrate the Merchant Portal - Marketplace Product + Tax feature into a Spryker project.

Install feature core

Follow the steps below to install the Merchant Portal - Marketplace Product + Tax feature core.

Prerequisites

To start feature integration, integrate the required features:

NAME VERSION INTEGRATION GUIDE
Marketplace Product 202108.0 Marketplace Product feature integration
Marketplace Merchant Portal Core 202108.0 Merchant Portal Core feature integration
Tax 202108.0 Tax feature integration

1) Install the required modules using Composer

Install the required modules:

composer require spryker/tax-merchant-portal-gui:"202108.0" --update-with-dependencies
Verification

Make sure that the following modules have been installed:

MODULE EXPECTED DIRECTORY
TaxMerchantPortalGui spryker/tax-merchant-portal-gui

2) Set up transfer objects

Generate transfer changes:

console transfer:generate
Verification

Make sure that the following changes have been applied in transfer objects:

TRANSFER TYPE EVENT PATH
TaxSetCollection class Created src/Generated/Shared/Transfer/TaxSetCollectionTransfer
TaxSet class Created src/Generated/Shared/Transfer/TaxSetTransfer

3) Set up behavior

Enable the following behaviors by registering the plugins:

PLUGIN DESCRIPTION PREREQUISITES NAMESPACE
TaxProductAbstractFormExpanderPlugin Expands ProductAbstractForm with the Tax Set field. Spryker\Zed\TaxMerchantPortalGui\Communication\Plugin\ProductMerchantPortalGui

src\Pyz\Zed\ProductMerchantPortalGui\ProductMerchantPortalGuiDependencyProvider.php

<?php

namespace Pyz\Zed\ProductMerchantPortalGui;

use Spryker\Zed\ProductMerchantPortalGui\ProductMerchantPortalGuiDependencyProvider as SprykerProductMerchantPortalGuiDependencyProvider;
use Spryker\Zed\TaxMerchantPortalGui\Communication\Plugin\ProductMerchantPortalGui\TaxProductAbstractFormExpanderPlugin;

class ProductMerchantPortalGuiDependencyProvider extends SprykerProductMerchantPortalGuiDependencyProvider
{
    /**
     * @return array<\Spryker\Zed\ProductMerchantPortalGuiExtension\Dependency\Plugin\ProductAbstractFormExpanderPluginInterface>
     */
    protected function getProductAbstractFormExpanderPlugins(): array
    {
        return [
            new TaxProductAbstractFormExpanderPlugin(),
        ];
    }
}
Verification

Make sure ProductAbstractForm has the TaxSet field.