Marketplace Order Management + Customer Account Management feature integration

Edit on GitHub

This document describes how to integrate the Marketplace Order Management + Customer Account Management feature into a Spryker project.

Install feature front end

Follow the steps below to install the Marketplace Order Management + Customer Account Management feature front end.

Prerequisites

To start feature integration, integrate the required features:

NAME VERSION INTEGRATION GUIDE
Marketplace Order Management 202108.0 Marketplace Order Management feature integration
Customer Account Management 202108.0 Customer Account Management feature integration

1) Set up the transfer objects

Generate transfer changes:

console transfer:generate
Verification

Make sure that the following changes were applied in transfer objects.

TRANSFER TYPE EVENT PATH
ShopContext.merchantReference attribute created src/Generated/Shared/Transfer/ShopContextTransfer

2) Set up behavior

Enable the following behaviors by registering the plugins:

PLUGIN SPECIFICATION PREREQUISITES NAMESPACE
MerchantSwitchCartAfterCustomerAuthenticationSuccessPlugin Sets merchant reference value to cookies if a customer’s quote contains it, and the quote is not empty. SprykerShop\Yves\MerchantSwitcherWidget\Plugin\CustomerPage
<?php

namespace Pyz\Yves\CustomerPage;

use SprykerShop\Yves\CustomerPage\CustomerPageDependencyProvider as SprykerShopCustomerPageDependencyProvider;
use SprykerShop\Yves\MerchantSwitcherWidget\Plugin\CustomerPage\MerchantSwitchCartAfterCustomerAuthenticationSuccessPlugin;

class CustomerPageDependencyProvider extends SprykerShopCustomerPageDependencyProvider
{
    /**
     * @return \SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\AfterCustomerAuthenticationSuccessPluginInterface[]
     */
    protected function getAfterCustomerAuthenticationSuccessPlugins(): array
    {
        return [
            new MerchantSwitchCartAfterCustomerAuthenticationSuccessPlugin(),
        ];
    }
}
Verification

Make sure that after customers log in, their selected merchant is not changed and set correctly.