Marketplace Product + Inventory Management feature integration

Edit on GitHub

This document describes how to integrate the Marketplace Product + Inventory Management feature into a Spryker project.

Install feature core

Follow the steps below to install the Marketplace Product + Inventory Management feature core.

Prerequisites

To start feature integration, integrate the required features:

NAME VERSION INTEGRATION GUIDE
Spryker Core 202108.0 Glue API: Spryker Core feature integration
Marketplace Merchant 202108.0 Marketplace Merchant feature integration
Product Management 202108.0 Inventory Management feature integration

Set up behavior

Enable the following behaviors by registering the plugins:

PLUGIN DESCRIPTION PREREQUISITES NAMESPACE
MerchantProductAvailabilityAbstractTableQueryCriteriaExpanderPlugin Expands QueryCriteriaTransfer with QueryJoinTransfer for filtering by idMerchant. Spryker\Zed\MerchantProductGui\Communication\Plugin\AvailabilityGui
MerchantProductAvailabilityViewActionViewDataExpanderPlugin Expands view data for product availability with merchant data. Spryker\Zed\MerchantProductGui\Communication\Plugin\AvailabilityGui

src/Pyz/Zed/AvailabilityGui/AvailabilityGuiDependencyProvider.php

<?php

namespace Pyz\Zed\AvailabilityGui;

use Spryker\Zed\AvailabilityGui\AvailabilityGuiDependencyProvider as SprykerAvailabilityGuiDependencyProvider;
use Spryker\Zed\MerchantProductGui\Communication\Plugin\AvailabilityGui\MerchantProductAvailabilityAbstractTableQueryCriteriaExpanderPlugin;
use Spryker\Zed\MerchantProductGui\Communication\Plugin\AvailabilityGui\MerchantProductAvailabilityViewActionViewDataExpanderPlugin;

class AvailabilityGuiDependencyProvider extends SprykerAvailabilityGuiDependencyProvider
{
    /**
     * @return \Spryker\Zed\AvailabilityGuiExtension\Dependency\Plugin\AvailabilityViewActionViewDataExpanderPluginInterface[]
     */
    protected function getAvailabilityViewActionViewDataExpanderPlugins(): array
    {
        return [
            new MerchantProductAvailabilityViewActionViewDataExpanderPlugin(),
        ];
    }

    /**
     * @return \Spryker\Zed\AvailabilityGuiExtension\Dependency\Plugin\AvailabilityAbstractTableQueryCriteriaExpanderPluginInterface[]
     */
    protected function getAvailabilityAbstractTableQueryCriteriaExpanderPlugins(): array
    {
        return [
            new MerchantProductAvailabilityAbstractTableQueryCriteriaExpanderPlugin(),
        ];
    }
}
Verification

Make sure that you can filter product availabilities by merchant at http://zed.de.demo-spryker.com/product-management.