Marketplace Merchant Portal Product Offer Management feature integration

Edit on GitHub

This document describes how to integrate the Marketplace Merchant Portal Product Offer Management feature into a Spryker project.

Prerequisites

To start feature integration, integrate the required features:

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

1) Install the required modules using Composer

Install the required modules:

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

Make sure that the following modules have been installed:

MODULE EXPECTED DIRECTORY
ProductOfferMerchantPortalGui spryker/product-offer-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
MerchantDashboardCard class Created src/Generated/Shared/Transfer/MerchantDashboardCard
MerchantProductOfferCounts class Created src/Generated/Shared/Transfer/MerchantProductOfferCounts

3) Set up behavior

To set up behavior, take the following steps.

Extend OrderItemsTable in SalesMerchantPortalGui

Activate the following plugins:

PLUGIN SPECIFICATION PREREQUISITES NAMESPACE
ProductOfferMerchantOrderItemTableExpanderPlugin Adds merchantReference and ProductOfferSku to Sales tables in the MerchantPortal. Marketplace Sales Merchant Portal integrated Spryker\Zed\ProductOfferMerchantPortalGui\Communication\Plugin

src/Pyz/Zed/SalesMerchantPortalGui/SalesMerchantPortalGuiDependencyProvider.php

<?php

namespace Pyz\Zed\SalesMerchantPortalGui;

use Spryker\Zed\ProductOfferMerchantPortalGui\Communication\Plugin\SalesMerchantPortalGui\ProductOfferMerchantOrderItemTableExpanderPlugin;
use Spryker\Zed\SalesMerchantPortalGui\SalesMerchantPortalGuiDependencyProvider as SprykerSalesMerchantPortalGuiDependencyProvider;

class SalesMerchantPortalGuiDependencyProvider extends SprykerSalesMerchantPortalGuiDependencyProvider
{
    /**
     * @return \Spryker\Zed\SalesMerchantPortalGuiExtension\Dependency\Plugin\MerchantOrderItemTableExpanderPluginInterface[]
     */
    protected function getMerchantOrderItemTableExpanderPlugins(): array
    {
        return [
            new ProductOfferMerchantOrderItemTableExpanderPlugin(),
        ];
    }
}
Verification

Make sure that the ProductOfferMerchantOrderItemTableExpanderPlugin is set up by opening http://zed.mysprykershop.com/sales-merchant-portal-gui/orders. Click on any of the orders and check that the Merchant Reference and Product Offer SKU are present.

Add the Offer widget to MerchantDashobard

Activate the following plugins:

PLUGIN SPECIFICATION PREREQUISITES NAMESPACE
OffersMerchantDashboardCardPlugin Adds Offers widget to MerchantDashobard. Spryker\Zed\ProductOfferMerchantPortalGui\Communication\Plugin

src/Pyz/Zed/DashboardMerchantPortalGui/DashboardMerchantPortalGuiDependencyProvider.php

<?php

namespace Pyz\Zed\DashboardMerchantPortalGui;

use Spryker\Zed\DashboardMerchantPortalGui\DashboardMerchantPortalGuiDependencyProvider as SprykerDashboardMerchantPortalGuiDependencyProvider;
use Spryker\Zed\ProductOfferMerchantPortalGui\Communication\Plugin\DashboardMerchantPortalGui\OffersMerchantDashboardCardPlugin;
class DashboardMerchantPortalGuiDependencyProvider extends SprykerDashboardMerchantPortalGuiDependencyProvider
{
    /**
     * @return \Spryker\Zed\DashboardMerchantPortalGuiExtension\Dependency\Plugin\MerchantDashboardCardPluginInterface[]
     */
    protected function getDashboardCardPlugins(): array
    {
        return [
            new OffersMerchantDashboardCardPlugin(),
        ];
    }
}
Verification

Make sure that the OffersMerchantDashboardCardPlugin plugin is set up by opening http://zed.mysprykershop.com/dashboard-portal-gui. The Offers widget should show up on the page.