Merchant Switcher + Customer Account Management feature integration
Edit on GitHubThis document describes how to integrate the Merchant Switcher + Customer Account Management feature into a Spryker project.
Install feature frontend
Follow the steps below to install the Marketplace Order Management + Customer Account Management feature frontend.
Prerequisites
To start feature integration, integrate the required features:
NAME | VERSION | INTEGRATION GUIDE |
---|---|---|
Merchant Switcher | 202212.0 | Merchant Switcher feature integration |
Customer Account Management | 202212.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 array<\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.
Thank you!
For submitting the form