diff --git a/_includes/pbc/all/install-features/202212.0/marketplace/install-marketplace-shipment-feature.md b/_includes/pbc/all/install-features/202212.0/marketplace/install-marketplace-shipment-feature.md index 00fb1cb711a..03f4e3ce4c1 100644 --- a/_includes/pbc/all/install-features/202212.0/marketplace/install-marketplace-shipment-feature.md +++ b/_includes/pbc/all/install-features/202212.0/marketplace/install-marketplace-shipment-feature.md @@ -12,7 +12,7 @@ Install the required features: | NAME | VERSION | INSTALLATION GUIDE | |-|-|-| -| Merchant | {{page.version}} | [Merchant feature integration](/docs/pbc/all/merchant-management/{{page.version}}/marketplace/install-and-upgrade/install-features/install-the-marketplace-merchant-feature.html) | +| Merchant | {{page.version}} | [Install the Merchant feature](/docs/pbc/all/merchant-management/{{page.version}}/marketplace/install-and-upgrade/install-features/install-the-marketplace-merchant-feature.html) | | Shipment | {{page.version}} | [Install the Shipment feature](/docs/pbc/all/carrier-management/{{site.version}}/base-shop/install-and-upgrade/install-features/install-the-shipment-feature.html) | diff --git a/_includes/pbc/all/install-features/202212.0/marketplace/install-the-marketplace-merchant-feature.md b/_includes/pbc/all/install-features/202212.0/marketplace/install-the-marketplace-merchant-feature.md index f2b8f40f26a..25c8ed50332 100644 --- a/_includes/pbc/all/install-features/202212.0/marketplace/install-the-marketplace-merchant-feature.md +++ b/_includes/pbc/all/install-features/202212.0/marketplace/install-the-marketplace-merchant-feature.md @@ -12,7 +12,7 @@ Install the required features: | NAME | VERSION |INTEGRATION GUIDE | | --- | --- | --- | | Spryker Core | {{page.version}} | [Install the Spryker Core feature](/docs/pbc/all/miscellaneous/{{page.version}}/install-and-upgrade/install-features/install-the-spryker-core-feature.html) | -| Merchant | {{page.version}} | [Merchant feature integration](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | +| Merchant | {{page.version}} | [Install the Merchant feature](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | ### 1) Install the required modules using Composer diff --git a/_includes/pbc/all/install-features/202307.0/marketplace/install-marketplace-shipment-feature.md b/_includes/pbc/all/install-features/202307.0/marketplace/install-marketplace-shipment-feature.md index 8edd7eec7e6..e0265a5bd3c 100644 --- a/_includes/pbc/all/install-features/202307.0/marketplace/install-marketplace-shipment-feature.md +++ b/_includes/pbc/all/install-features/202307.0/marketplace/install-marketplace-shipment-feature.md @@ -10,7 +10,7 @@ Install the required features: | NAME | VERSION | INSTALLATION GUIDE | |-|-|-| -| Merchant | {{page.version}} | [Merchant feature integration](/docs/pbc/all/merchant-management/{{page.version}}/marketplace/install-and-upgrade/install-features/install-the-marketplace-merchant-feature.html) | +| Merchant | {{page.version}} | [Install the Merchant feature](/docs/pbc/all/merchant-management/{{page.version}}/marketplace/install-and-upgrade/install-features/install-the-marketplace-merchant-feature.html) | | Shipment | {{page.version}} | [Install the Shipment feature](/docs/pbc/all/carrier-management/{{site.version}}/base-shop/install-and-upgrade/install-features/install-the-shipment-feature.html) | diff --git a/_includes/pbc/all/install-features/202307.0/marketplace/install-the-marketplace-merchant-feature.md b/_includes/pbc/all/install-features/202307.0/marketplace/install-the-marketplace-merchant-feature.md index f2b8f40f26a..25c8ed50332 100644 --- a/_includes/pbc/all/install-features/202307.0/marketplace/install-the-marketplace-merchant-feature.md +++ b/_includes/pbc/all/install-features/202307.0/marketplace/install-the-marketplace-merchant-feature.md @@ -12,7 +12,7 @@ Install the required features: | NAME | VERSION |INTEGRATION GUIDE | | --- | --- | --- | | Spryker Core | {{page.version}} | [Install the Spryker Core feature](/docs/pbc/all/miscellaneous/{{page.version}}/install-and-upgrade/install-features/install-the-spryker-core-feature.html) | -| Merchant | {{page.version}} | [Merchant feature integration](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | +| Merchant | {{page.version}} | [Install the Merchant feature](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | ### 1) Install the required modules using Composer diff --git a/_includes/pbc/all/install-features/202311.0/install-the-data-exchange-api.md b/_includes/pbc/all/install-features/202311.0/install-the-data-exchange-api.md index 2ca47f47210..71f46996a4f 100644 --- a/_includes/pbc/all/install-features/202311.0/install-the-data-exchange-api.md +++ b/_includes/pbc/all/install-features/202311.0/install-the-data-exchange-api.md @@ -12,7 +12,7 @@ Install the required features: | NAME | VERSION | INSTALLATION GUIDE | | --- | --- | --- | -| Glue Backend Api Application | {{page.version}} | [Glue API - Glue Storefront and Backend API applications integration](/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-storefront-and-backend-glue-api-applications.html) | +| Glue Backend Api Application | {{page.version}} | [Integrate Storefront and Backend Glue API applications](/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-storefront-and-backend-glue-api-applications.html) | | Glue Authentication | {{page.version}} | [Glue API - Authentication integration](/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-the-authentication.html) | ### Install the required modules diff --git a/_includes/pbc/all/install-features/202311.0/marketplace/install-marketplace-shipment-feature.md b/_includes/pbc/all/install-features/202311.0/marketplace/install-marketplace-shipment-feature.md index 8edd7eec7e6..e0265a5bd3c 100644 --- a/_includes/pbc/all/install-features/202311.0/marketplace/install-marketplace-shipment-feature.md +++ b/_includes/pbc/all/install-features/202311.0/marketplace/install-marketplace-shipment-feature.md @@ -10,7 +10,7 @@ Install the required features: | NAME | VERSION | INSTALLATION GUIDE | |-|-|-| -| Merchant | {{page.version}} | [Merchant feature integration](/docs/pbc/all/merchant-management/{{page.version}}/marketplace/install-and-upgrade/install-features/install-the-marketplace-merchant-feature.html) | +| Merchant | {{page.version}} | [Install the Merchant feature](/docs/pbc/all/merchant-management/{{page.version}}/marketplace/install-and-upgrade/install-features/install-the-marketplace-merchant-feature.html) | | Shipment | {{page.version}} | [Install the Shipment feature](/docs/pbc/all/carrier-management/{{site.version}}/base-shop/install-and-upgrade/install-features/install-the-shipment-feature.html) | diff --git a/_includes/pbc/all/install-features/202311.0/marketplace/install-the-marketplace-merchant-feature.md b/_includes/pbc/all/install-features/202311.0/marketplace/install-the-marketplace-merchant-feature.md index f2b8f40f26a..25c8ed50332 100644 --- a/_includes/pbc/all/install-features/202311.0/marketplace/install-the-marketplace-merchant-feature.md +++ b/_includes/pbc/all/install-features/202311.0/marketplace/install-the-marketplace-merchant-feature.md @@ -12,7 +12,7 @@ Install the required features: | NAME | VERSION |INTEGRATION GUIDE | | --- | --- | --- | | Spryker Core | {{page.version}} | [Install the Spryker Core feature](/docs/pbc/all/miscellaneous/{{page.version}}/install-and-upgrade/install-features/install-the-spryker-core-feature.html) | -| Merchant | {{page.version}} | [Merchant feature integration](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | +| Merchant | {{page.version}} | [Install the Merchant feature](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | ### 1) Install the required modules using Composer diff --git a/_includes/pbc/all/install-features/202311.0/marketplace/install-the-marketplace-merchant-product-offer-service-points-availability-feature.md b/_includes/pbc/all/install-features/202311.0/marketplace/install-the-marketplace-merchant-product-offer-service-points-availability-feature.md index 9bf61b66ea2..3988b10bfd0 100644 --- a/_includes/pbc/all/install-features/202311.0/marketplace/install-the-marketplace-merchant-product-offer-service-points-availability-feature.md +++ b/_includes/pbc/all/install-features/202311.0/marketplace/install-the-marketplace-merchant-product-offer-service-points-availability-feature.md @@ -9,7 +9,7 @@ Install the required features: | NAME | VERSION | INSTALLATION GUIDE | |-------------------------------------------|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Product Offer Service Points Availability | {{page.version}} | [Install the Product Offer Service Points Availability feature](/docs/pbc/all/service-points/{{page.version}}/unified-commerce/install-and-upgrade/install-the-product-offer-service-points-availability-feature.html) | -| Merchant | {{page.version}} | [Merchant feature integration](/docs/pbc/all/merchant-management/{{page.version}}/marketplace/install-and-upgrade/install-features/install-the-marketplace-merchant-feature.html) | +| Merchant | {{page.version}} | [Install the Merchant feature](/docs/pbc/all/merchant-management/{{page.version}}/marketplace/install-and-upgrade/install-features/install-the-marketplace-merchant-feature.html) | ## 1) Install the required modules diff --git a/_includes/pbc/all/install-features/202403.0/marketplace/install-the-marketplace-merchant-feature.md b/_includes/pbc/all/install-features/202403.0/marketplace/install-the-marketplace-merchant-feature.md new file mode 100644 index 00000000000..2ad8de12ae7 --- /dev/null +++ b/_includes/pbc/all/install-features/202403.0/marketplace/install-the-marketplace-merchant-feature.md @@ -0,0 +1,1652 @@ + +This document describes how to install the Marketplace Merchant feature. + +## Install feature core + +Follow the steps below to install the Marketplace Merchant feature core. + +### Prerequisites + +Install the required features: + +| NAME | VERSION | INTEGRATION GUIDE | +|--------------------------------|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Spryker Core | {{page.version}} | [Install the Spryker Core feature](/docs/pbc/all/miscellaneous/{{page.version}}/install-and-upgrade/install-features/install-the-spryker-core-feature.html) | +| Merchant | {{page.version}} | [Install the Merchant feature](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | + +### 1) Install the required modules using Composer + +```bash +composer require spryker-feature/marketplace-merchant:"{{page.version}}" --update-with-dependencies +``` + +{% info_block warningBox "Verification" %} + +Make sure that the following modules have been installed: + +| MODULE | EXPECTED DIRECTORY | +|---------------------------|---------------------------------------------| +| MerchantProfile | vendor/spryker/merchant-profile | +| MerchantProfileDataImport | vendor/spryker/merchant-profile-data-import | +| MerchantProfileGui | vendor/spryker/merchant-profile-gui | +| MerchantSearch | vendor/spryker/merchant-search | +| MerchantSearchExtension | vendor/spryker/merchant-search-extension | +| MerchantUser | vendor/spryker/merchant-user | +| MerchantUserGui | vendor/spryker/merchant-user-gui | +| MerchantStorage | vendor/spryker/merchant-storage | +| OauthMerchantUser | vendor/spryker/oauth-merchant-user | + +{% endinfo_block %} + +### 2) Set up database schema and transfer objects + +1. Adjust the schema definition so entity changes trigger events: + +**src/Pyz/Zed/MerchantSearch/Persistence/Propel/Schema/spy_merchant_search.schema.xml** + +```xml + + + + + + + +
+ +
+ +``` + +2. Apply database changes, generate entity and transfer changes: + +```bash +console transfer:generate +console propel:install +console transfer:generate +``` + +{% info_block warningBox "Verification" %} + +Make sure that the following changes have occurred in the database: + +| DATABASE ENTITY | TYPE | EVENT | +|----------------------|-------|---------| +| spy_merchant_storage | table | created | +| spy_merchant_search | table | created | +| spy_merchant_profile | table | created | +| spy_merchant_user | table | created | + +{% endinfo_block %} + +Generate transfer changes: + +```bash +console transfer:generate +``` + +{% info_block warningBox "Verification" %} + +Make sure that the following changes have occurred in transfer objects: + +| TRANSFER | TYPE | EVENT | PATH | +|--------------------------------------------|----------|---------|----------------------------------------------------------------------------------| +| MerchantProfileAddress | class | Created | src/Generated/Shared/Transfer/MerchantProfileAddressTransfer | +| MerchantProfileCollection | class | Created | src/Generated/Shared/Transfer/MerchantProfileCollectionTransfer | +| MerchantProfileCriteria | class | Created | src/Generated/Shared/Transfer/MerchantProfileCriteriaTransfer | +| MerchantProfileGlossaryAttributeValues | class | Created | src/Generated/Shared/Transfer/MerchantProfileGlossaryAttributeValuesTransfer | +| MerchantProfileLocalizedGlossaryAttributes | class | Created | src/Generated/Shared/Transfer/MerchantProfileLocalizedGlossaryAttributesTransfer | +| MerchantSearch | class | Created | src/Generated/Shared/Transfer/MerchantSearchTransfer | +| MerchantSearchCollection | class | Created | src/Generated/Shared/Transfer/MerchantSearchCollectionTransfer | +| MerchantUser | class | Created | src/Generated/Shared/Transfer/MerchantUserTransfer | +| MerchantUserCriteria | class | Created | src/Generated/Shared/Transfer/MerchantUserCriteriaTransfer | +| MerchantUserResponse | class | Created | src/Generated/Shared/Transfer/MerchantUserResponseTransfer | +| SpyMerchantProfileEntity | class | Created | src/Generated/Shared/Transfer/SpyMerchantProfileEntityTransfer | +| SpyMerchantSearchEntity | class | Created | src/Generated/Shared/Transfer/SpyMerchantSearchEntityTransfer | +| SpyMerchantStorageEntity | class | Created | src/Generated/Shared/Transfer/SpyMerchantStorageEntityTransfer | +| SpyMerchantUserEntity | class | Created | src/Generated/Shared/Transfer/SpyMerchantUserEntityTransfer | +| UrlStorage.fkResourceMerchant | property | Created | src/Generated/Shared/Transfer/UrlStorageTransfer | + +{% endinfo_block %} + +### 3) Optional: Set up configuration + +1. [Integrate Glue authentication](/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-the-authentication.html). + +2. Define the endpoints which merchant users have access to: + +**src/Pyz/Zed/OauthMerchantUser/OauthMerchantUserConfig.php** + +```php + [ + * 'isRegularExpression' => false, + * ], + * '/\/example\/.+/' => [ + * 'isRegularExpression' => true, + * 'methods' => [ + * 'patch', + * 'delete', + * ], + * ], + * ] + * + * @api + * + * @return array + */ + public function getAllowedForMerchantUserPaths(): array + { + return []; + } +} +``` + +### 4) Add Zed translations + +Generate new translation cache for Zed: + +```bash +console translator:generate-cache +``` + +### 5) Set up behavior + +Enable the following behaviors by registering the plugins: + +| PLUGIN | DESCRIPTION | PREREQUISITES | NAMESPACE | +|------------------------------------------------------|----------------------------------------------------------------------------------------------------------|---------------|----------------------------------------------------------------------| +| MerchantProfileMerchantBulkExpanderPlugin | Expands merchants with profile data. | | Spryker\Zed\MerchantProfile\Communication\Plugin\Merchant | +| MerchantProfileMerchantPostCreatePlugin | Creates merchant profile on merchant create action. | | Spryker\Zed\MerchantProfile\Communication\Plugin\Merchant | +| MerchantProfileMerchantPostUpdatePlugin | Updates merchant profile on merchant update action.m | | Spryker\Zed\MerchantProfile\Communication\Plugin\Merchant | +| MerchantProfileContactPersonFormTabExpanderPlugin | Adds an extra tab to merchant edit and create forms for editing and creating contact person data. | | Spryker\Zed\MerchantProfileGui\Communication\Plugin\MerchantGui\Tabs | +| MerchantProfileFormTabExpanderPlugin | Adds an extra tab to merchant edit and create forms for editing and creating merchant profile data. | | Spryker\Zed\MerchantProfileGui\Communication\Plugin\MerchantGui\Tabs | +| MerchantProfileLegalInformationFormTabExpanderPlugin | Adds an extra tab to merchant edit and create forms for editing and creating merchant legal information. | | Spryker\Zed\MerchantProfileGui\Communication\Plugin\MerchantGui\Tabs | +| MerchantProfileFormExpanderPlugin | Expands MerchantForm with merchant profile fields. | | Spryker\Zed\MerchantProfileGui\Communication\Plugin\MerchantGui | +| SyncMerchantUsersStatusMerchantPostUpdatePlugin | Updates merchant users status by merchant status on merchant update. | | Spryker\Zed\MerchantUser\Communication\Plugin\Merchant | +| MerchantUserTabMerchantFormTabExpanderPlugin | Adds an extra tab to merchant edit and create forms for editing and creating merchant user information. | | Spryker\Zed\MerchantUserGui\Communication\Plugin\MerchantGui | +| MerchantUserViewMerchantUpdateFormViewExpanderPlugin | Expands merchant `FormView` with the data for the merchant user tab. | | Spryker\Zed\MerchantUserGui\Communication\Plugin\MerchantGui | +| MerchantProductOfferStorageExpanderPlugin | Returns `ProductOfferStorage` transfer object expanded with `Merchant`. | | Spryker\Client\MerchantStorage\Plugin\ProductOfferStorage | +| MerchantProductOfferStorageFilterPlugin | Filters `ProductOfferCollection` transfer object by active and approved merchant. | | Spryker\Zed\MerchantStorage\Communication\Plugin\ProductOfferStorage | + +
src/Pyz/Zed/Merchant/MerchantDependencyProvider.php + +```php + + */ + protected function getMerchantPostCreatePlugins(): array + { + return [ + new MerchantProfileMerchantPostCreatePlugin(), + ]; + } + + /** + * @return array<\Spryker\Zed\MerchantExtension\Dependency\Plugin\MerchantPostUpdatePluginInterface> + */ + protected function getMerchantPostUpdatePlugins(): array + { + return [ + new MerchantProfileMerchantPostUpdatePlugin(), + new SyncMerchantUsersStatusMerchantPostUpdatePlugin(), + ]; + } + + /** + * @return list<\Spryker\Zed\MerchantExtension\Dependency\Plugin\MerchantBulkExpanderPluginInterface> + */ + protected function getMerchantBulkExpanderPlugins(): array + { + return [ + new MerchantProfileMerchantBulkExpanderPlugin(), + ]; + } +} +``` + +
+ +{% info_block warningBox "Verification" %} + +Make sure the following applies: + +* When you create a merchant using `MerchantFacade::createMerchant()`, its profile also gets created. +* When you update a merchant using `MerchantFacade::updateMerchant()`, its profile also gets updated. +* When you fetch a merchant using `MerchantFacade::findOne()`, its profile data also gets fetched. + +{% endinfo_block %} + +
src/Pyz/Zed/MerchantGui/MerchantGuiDependencyProvider.php + +```php + + */ + protected function getMerchantFormExpanderPlugins(): array + { + return [ + new MerchantProfileFormExpanderPlugin(), + ]; + } + + /** + * @return array<\Spryker\Zed\MerchantGuiExtension\Dependency\Plugin\MerchantFormTabExpanderPluginInterface> + */ + protected function getMerchantFormTabsExpanderPlugins(): array + { + return [ + new MerchantProfileContactPersonFormTabExpanderPlugin(), + new MerchantProfileFormTabExpanderPlugin(), + new MerchantProfileLegalInformationFormTabExpanderPlugin(), + new MerchantUserTabMerchantFormTabExpanderPlugin(), + ]; + } + + /** + * @return array<\Spryker\Zed\MerchantGuiExtension\Dependency\Plugin\MerchantUpdateFormViewExpanderPluginInterface> + */ + protected function getMerchantUpdateFormViewExpanderPlugins(): array + { + return [ + new MerchantUserViewMerchantUpdateFormViewExpanderPlugin(), + ]; + } + +} + +``` + +
+ +{% info_block warningBox "Verification" %} + +Make sure that, on the **Edit Merchant: `merchant_id`** page in the Back Office, you can see the following tabs: +* **Contact Person** +* **Merchant Profile** +* **Legal Information** +* **Merchant User** + +{% endinfo_block %} + +**src/Pyz/Client/ProductOfferStorage/ProductOfferStorageDependencyProvider.php** + +```php + + */ + protected function getProductOfferStorageExpanderPlugins(): array + { + return [ + new MerchantProductOfferStorageExpanderPlugin(), + ]; + } +} +``` + +**src/Pyz/Zed/ProductOfferStorage/ProductOfferStorageDependencyProvider.php** + +```php + + */ + protected function getProductOfferStorageFilterPlugins(): array + { + return [ + new MerchantProductOfferStorageFilterPlugin(), + ]; + } +} +``` + +{% info_block warningBox "Verification" %} + +Make sure that, when you retrieve a product offer from storage, you can see the merchant transfer property. + +{% endinfo_block %} + +#### Optional: Enable the Backend API authentication + +1. [Integrate Glue authentication](/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-the-authentication.html). + + +2. Register the following plugins: + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|------------------------------------------------------|----------------------------------------------------|---------------|-----------------------------------------------------------------------| +| MerchantUserTypeOauthScopeAuthorizationCheckerPlugin | Authorizes user by merchant user scopes. | | Spryker\Zed\OauthMerchantUser\Communication\Plugin\OauthUserConnector | +| MerchantUserTypeOauthScopeProviderPlugin | Provides the OAuth scopes related to merchant users. | | Spryker\Zed\OauthMerchantUser\Communication\Plugin\OauthUserConnector | + +**src/Pyz/Zed/OauthUserConnector/OauthUserConnectorDependencyProvider.php** + +```php + + */ + protected function getUserTypeOauthScopeProviderPlugins(): array + { + return [ + new MerchantUserTypeOauthScopeProviderPlugin(), + ]; + } + + /** + * @return list<\Spryker\Zed\OauthUserConnectorExtension\Dependency\Plugin\UserTypeOauthScopeAuthorizationCheckerPluginInterface> + */ + protected function getUserTypeOauthScopeAuthorizationCheckerPlugins(): array + { + return [ + new MerchantUserTypeOauthScopeAuthorizationCheckerPlugin(), + ]; + } +} +``` + +{% info_block warningBox "Verification" %} + +1. Make sure that you can authenticate as a merchant user: + +* `POST https://glue-backend.mysprykershop.com/token` + +```json +{ + "data": { + "type": "token", + "attributes": { + "grant_type": "password", + "username": {% raw %}{{{% endraw %}username{% raw %}}}{% endraw %}, + "password": {% raw %}{{{% endraw %}password{% raw %}}}{% endraw %}, + } + } +} +``` + +Make sure the output contains the 201 response with a valid token. Make sure that the warehouse user can assess only the endpoints specified in **src/Pyz/Zed/OauthMerchantUser/OauthMerchantUserConfig.php**. + +{% endinfo_block %} + +### 6) Configure navigation + +1. Add the marketplace section to the navigation: + +**config/Zed/navigation.xml** +```xml + + + + + Marketplace + fa-shopping-basket + + + + Merchants + merchant-gui + list-merchant + index + + + + +``` + +2. Build the navigation cache: + +```bash +console navigation:build-cache +``` + +{% info_block warningBox "Verification" %} + +Make sure there is the **Marketplace** button in the Back Office navigation. + +{% endinfo_block %} + +### 7) Configure export to Redis and Elasticsearch + +This step publishes tables on change (create, edit) to `spy_merchant_profile_storage` and synchronizes data to Storage. + +#### Configure export to Redis + +1. Set up event listeners and publishers: + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|--------------------------------|---------------------------------------------------------------------------|---------------|----------------------------------------------------------------------------------------------------| +| MerchantPublisherTriggerPlugin | Registers the publishers that publish merchant entity changes to storage. | | Spryker\Zed\MerchantStorage\Communication\Plugin\Publisher\MerchantPublisherTriggerPlugin | +| MerchantStoragePublisherPlugin | Publishes merchant data to the `spy_merchant_storage` table. | | Spryker\Zed\MerchantStorage\Communication\Plugin\Publisher\Merchant\MerchantStoragePublisherPlugin | + +**src/Pyz/Zed/Publisher/PublisherDependencyProvider.php** + +```php + + */ + protected function getPublisherPlugins(): array + { + return [ + new MerchantStoragePublisherPlugin(), + ]; + } + + /** + * @return array<\Spryker\Zed\PublisherExtension\Dependency\Plugin\PublisherTriggerPluginInterface> + */ + protected function getPublisherTriggerPlugins(): array + { + return [ + new MerchantPublisherTriggerPlugin(), + ]; + } +} +``` + +2. Register synchronization and synchronization error queues: + +**src/Pyz/Client/RabbitMq/RabbitMqConfig.php** + +```php + QueueNameFoo, (Queue and error queue will be created: QueueNameFoo and QueueNameFoo.error) + * QueueNameBar => [ + * RoutingKeyFoo => QueueNameBaz, // (Additional queues can be defined by several routing keys) + * ], + * + * @see https://www.rabbitmq.com/tutorials/amqp-concepts.html + * + * @return array + */ + protected function getQueueConfiguration(): array + { + return [ + MerchantStorageConfig::MERCHANT_SYNC_STORAGE_QUEUE, + ]; + } +} + +``` + +3. Configure message processors: + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|---------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|---------------|--------------------------------------------------------| +| SynchronizationStorageQueueMessageProcessorPlugin | Configures all merchant profile messages to synchronize with Redis and marks messages as failed in case of an error. | | Spryker\Zed\Synchronization\Communication\Plugin\Queue | + +**src/Pyz/Zed/MerchantStorage/MerchantStorageConfig.php** + +```php + + */ + protected function getProcessorMessagePlugins(Container $container) + { + return [ + MerchantStorageConfig::MERCHANT_SYNC_STORAGE_QUEUE => new SynchronizationStorageQueueMessageProcessorPlugin(), + ]; + } +} +``` + +4. Set up re-generate and re-sync features: + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|-----------------------------------|---------------------------------------------------------------------------------|---------------|------------------------------------------------------------------| +| MerchantSynchronizationDataPlugin | Enables the content of an entire storage table to be synchronized into Storage. | | Spryker\Zed\MerchantStorage\Communication\Plugin\Synchronization | + +**src/Pyz/Zed/Synchronization/SynchronizationDependencyProvider.php** + +```php + + */ + protected function getSynchronizationDataPlugins(): array + { + return [ + new MerchantSynchronizationDataPlugin(), + ]; + } +} +``` + +{% info_block warningBox "Verification" %} + +Make sure that when merchant profile entities are created or updated through ORM, they are exported to Redis accordingly. + +{% endinfo_block %} + + +##### Configure export to Elastica + +This step publishes tables on change (create, edit) to `spy_merchant_search` and synchronizes the data to Search. + +1. Set up event listeners and publishers by registering the plugins: + +**src/Pyz/Zed/Publisher/PublisherDependencyProvider.php** + +```php + + */ + protected function getPublisherPlugins(): array + { + return [ + new MerchantWritePublisherPlugin(), + new MerchantDeletePublisherPlugin(), + ]; + } +} +``` + +2. Register a synchronization queue: + +**src/Pyz/Client/RabbitMq/RabbitMqConfig.php** + +```php + + */ + protected function getProcessorMessagePlugins(Container $container) + { + return [ + MerchantSearchConfig::SYNC_SEARCH_MERCHANT => new SynchronizationSearchQueueMessageProcessorPlugin(), + ]; + } +} +``` + +4. Setup re-generate and re-sync features: + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|-------------------------------------------------|-----------------------------------------------------------|---------------|-----------------------------------------------------------------| +| MerchantSynchronizationDataBulkRepositoryPlugin | Synchronizes the entire search table content into Search. | | Spryker\Zed\MerchantSearch\Communication\Plugin\Synchronization | + +**src/Pyz/Zed/Synchronization/SynchronizationDependencyProvider.php** + +```php + + */ + protected function getSynchronizationDataPlugins(): array + { + return [ + new MerchantSynchronizationDataBulkRepositoryPlugin(), + ]; + } +} +``` + +5. Configure a synchronization pool name: + +**src/Pyz/Zed/MerchantSearch/MerchantSearchConfig.php** + +```php + + */ + protected function getMerchantSearchResultFormatterPlugins(): array + { + return [ + new MerchantSearchResultFormatterPlugin(), + ]; + } +} +``` + +7. Set up query expanders: + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|--------------------------------------------|-----------------------------------------------------------------------------------|---------------|----------------------------------------------------------| +| PaginatedMerchantSearchQueryExpanderPlugin | Allows using pagination for merchant search. | | Spryker\Client\MerchantSearch\Plugin\Elasticsearch\Query | +| StoreQueryExpanderPlugin | Allows searching to filter out merchants that do not belong to the current store. | | Spryker\Client\SearchElasticsearch\Plugin\QueryExpander | + +**src/Pyz/Client/MerchantSearch/MerchantSearchDependencyProvider.php** + +```php + + */ + protected function getMerchantSearchQueryExpanderPlugins(): array + { + return [ + new PaginatedMerchantSearchQueryExpanderPlugin(), + new StoreQueryExpanderPlugin(), + ]; + } +} +``` + +8. Add the `merchant` resource to the supported search sources: + +**src/Pyz/Shared/SearchElasticsearch/SearchElasticsearchConfig.php** + +```php + +Example of the expected data fragment + + ```json + + { + "idMerchant": 1, + "name": "Sony Experts", + "registrationNumber": "HYY 134306", + "email": "michele@sony-experts.com", + "status": "approved", + "isActive": true, + "merchantReference": "MER000006", + "fkStateMachineProcess": 1, + "storeRelation": { + "idEntity": 1, + "idStores": [ + 1 + ], + "stores": [ + { + "availableLocaleIsoCodes": [], + "queuePools": [], + "storesWithSharedPersistence": [], + "idStore": 1, + "name": "DE", + "defaultCurrencyIsoCode": null, + "availableCurrencyIsoCodes": [], + "selectedCurrencyIsoCode": null, + "timezone": null, + "countries": [] + } + ] + }, + "addressCollection": null, + "merchantProfile": { + "idMerchantProfile": 3, + "contactPersonRole": "Brand Manager", + "contactPersonTitle": "Ms", + "contactPersonFirstName": "Michele", + "contactPersonLastName": "Nemeth", + "contactPersonPhone": "030/123456789", + "logoUrl": "https://d2s0ynfc62ej12.cloudfront.net/merchant/sonyexperts-logo.png", + "publicEmail": "support@sony-experts.com", + "publicPhone": "+49 30 234567691", + "descriptionGlossaryKey": "merchant.description_glossary_key.1", + "bannerUrlGlossaryKey": "merchant.banner_url_glossary_key.1", + "deliveryTimeGlossaryKey": "merchant.delivery_time_glossary_key.1", + "termsConditionsGlossaryKey": "merchant.terms_conditions_glossary_key.1", + "cancellationPolicyGlossaryKey": "merchant.cancellation_policy_glossary_key.1", + "imprintGlossaryKey": "merchant.imprint_glossary_key.1", + "dataPrivacyGlossaryKey": "merchant.data_privacy_glossary_key.1", + "fkMerchant": 1, + "merchantName": "Sony Experts", + "latitude": "11.547788", + "longitude": "48.131058", + "faxNumber": "+49 30 234567600", + "merchantReference": "MER000006", + "bannerUrl": null, + "addressCollection": { + "addresses": [ + { + "idMerchantProfileAddress": 3, + "fkCountry": 60, + "countryName": "Germany", + "address1": "Matthias-Pschorr-Straße", + "address2": "1", + "address3": "", + "city": "München", + "zipCode": "80336", + "email": null, + "fkMerchantProfile": 3 + } + ] + }, + "merchantProfileLocalizedGlossaryAttributes": [] + }, + "urlCollection": [ + { + "url": "/de/merchant/sony-experts", + "resourceType": null, + "resourceId": null, + "fkLocale": 46, + "idUrl": 505, + "fkResourceCategorynode": null, + "fkRedirect": null, + "fkResourcePage": null, + "fkResourceRedirect": null, + "fkResourceMerchant": 1, + "urlPrefix": null, + "localeName": "de_DE", + "fkResourceProductAbstract": null, + "fkResourceProductSet": null, + "itemType": null, + "itemId": null, + "fkProductAbstract": null, + "fkCategorynode": null, + "fkPage": null + }, + { + "url": "/en/merchant/sony-experts", + "resourceType": null, + "resourceId": null, + "fkLocale": 66, + "idUrl": 506, + "fkResourceCategorynode": null, + "fkRedirect": null, + "fkResourcePage": null, + "fkResourceRedirect": null, + "fkResourceMerchant": 1, + "urlPrefix": null, + "localeName": "en_US", + "fkResourceProductAbstract": null, + "fkResourceProductSet": null, + "itemType": null, + "itemId": null, + "fkProductAbstract": null, + "fkCategorynode": null, + "fkPage": null + } + ], + "categories": [ + { + "idCategory": 2, + "categoryKey": "cameras-and-camcorder", + "isActive": true, + "isInMenu": true, + "isClickable": true, + "isSearchable": true, + "name": null, + "url": null, + "imageName": null, + "categoryImageName": null, + "metaTitle": null, + "metaDescription": null, + "metaKeywords": null, + "fkCategoryTemplate": 1, + "idCmsBlocks": [], + "categoryNode": null, + "nodeCollection": null, + "parentCategoryNode": null, + "localizedAttributes": [ + { + "name": "Kameras & Camcorders", + "url": null, + "metaTitle": "Kameras & Camcorders", + "metaDescription": "Kameras & Camcorders", + "metaKeywords": "Kameras & Camcorders", + "locale": { + "idLocale": 46, + "localeName": "de_DE", + "name": null, + "isActive": true + }, + "image": null + }, + { + "name": "Cameras & Camcordersshhhhjjj", + "url": null, + "metaTitle": "Cameras & Camcorders", + "metaDescription": "Cameras & Camcorders", + "metaKeywords": "Cameras & Camcorders", + "locale": { + "idLocale": 66, + "localeName": "en_US", + "name": null, + "isActive": true + }, + "image": null + } + ], + "extraParents": [], + "imageSets": [] + } + ], + "stocks": [ + { + "idStock": 7, + "name": "Sony Experts MER000006 Warehouse 1", + "isActive": true, + "storeRelation": null + } + ] +} +``` + + + +### 8) Import data + +To import data follow the steps in the following sections. + +### Import merchant profile data + +1. Prepare merchant profile data according to your requirements using the demo data: + +
+/data/import/common/common/marketplace/merchant_profile.csv + +```csv +merchant_reference,contact_person_role,contact_person_title,contact_person_first_name,contact_person_last_name,contact_person_phone,banner_url,logo_url,public_email,public_phone,description_glossary_key.en_US,description_glossary_key.de_DE,banner_url_glossary_key.en_US,banner_url_glossary_key.de_DE,delivery_time_glossary_key.en_US,delivery_time_glossary_key.de_DE,terms_conditions_glossary_key.en_US,terms_conditions_glossary_key.de_DE,cancellation_policy_glossary_key.en_US,cancellation_policy_glossary_key.de_DE,imprint_glossary_key.en_US,imprint_glossary_key.de_DE,data_privacy_glossary_key.en_US,data_privacy_glossary_key.de_DE,is_active,fax_number +MER000001,E-Commerce Manager,Mr,Harald,Schmidt,+49 30 208498350,https://d2s0ynfc62ej12.cloudfront.net/merchant/spryker-banner.png,https://d2s0ynfc62ej12.cloudfront.net/merchant/spryker-logo.png,info@spryker.com,+49 30 234567891,Spryker is the main merchant at the Demo Marketplace.,Spryker ist der Haupthändler auf dem Demo-Marktplatz.,https://d2s0ynfc62ej12.cloudfront.net/merchant/spryker-banner.png,https://d2s0ynfc62ej12.cloudfront.net/merchant/spryker-banner.png,1-3 days,1-3 Tage,"

General Terms

(1) This privacy policy has been compiled to better serve those who are concerned with how their 'Personally identifiable information' (PII) is being used online. PII, as used in US privacy law and information security, is information that can be used on its own or with other information to identify, contact, or locate a single person, or to identify an individual in context. Please read our privacy policy carefully to get a clear understanding of how we collect, use, protect or otherwise handle your Personally Identifiable Information in accordance with our website.

(2) We do not collect information from visitors of our site or other details to help you with your experience.

Using your Information

We may use the information we collect from you when you register, make a purchase, sign up for our newsletter, respond to a survey or marketing communication, surf the website, or use certain other site features in the following ways:

To personalize user's experience and to allow us to deliver the type of content and product offerings in which you are most interested.

Protecting visitor information

Our website is scanned on a regular basis for security holes and known vulnerabilities in order to make your visit to our site as safe as possible. Your personal information is contained behind secured networks and is only accessible by a limited number of persons who have special access rights to such systems, and are required to keep the information confidential. In addition, all sensitive/credit information you supply is encrypted via Secure Socket Layer (SSL) technology.

","

§ 1 Geltungsbereich & Abwehrklausel

(1) Für die über diesen Internet-Shop begründeten Rechtsbeziehungen zwischen dem Betreiber des Shops (nachfolgend „Anbieter“) und seinen Kunden gelten ausschließlich die folgenden Allgemeinen Geschäftsbedingungen in der jeweiligen Fassung zum Zeitpunkt der Bestellung.

(2) Abweichende Allgemeine Geschäftsbedingungen des Kunden werden zurückgewiesen.

§ 2 Zustandekommen des Vertrages

(1) Die Präsentation der Waren im Internet-Shop stellt kein bindendes Angebot des Anbieters auf Abschluss eines Kaufvertrages dar. Der Kunde wird hierdurch lediglich aufgefordert, durch eine Bestellung ein Angebot abzugeben.

(2) Durch das Absenden der Bestellung im Internet-Shop gibt der Kunde ein verbindliches Angebot gerichtet auf den Abschluss eines Kaufvertrages über die im Warenkorb enthaltenen Waren ab. Mit dem Absenden der Bestellung erkennt der Kunde auch diese Geschäftsbedingungen als für das Rechtsverhältnis mit dem Anbieter allein maßgeblich an.

(3) Der Anbieter bestätigt den Eingang der Bestellung des Kunden durch Versendung einer Bestätigungs-Email. Diese Bestellbestätigung stellt noch nicht die Annahme des Vertragsangebotes durch den Anbieter dar. Sie dient lediglich der Information des Kunden, dass die Bestellung beim Anbieter eingegangen ist. Die Erklärung der Annahme des Vertragsangebotes erfolgt durch die Auslieferung der Ware oder eine ausdrückliche Annahmeerklärung.

§ 3 Eigentumsvorbehalt

Die gelieferte Ware verbleibt bis zur vollständigen Bezahlung im Eigentum des Anbieters.

§ 4 Fälligkeit

Die Zahlung des Kaufpreises ist mit Vertragsschluss fällig.

","You have the right to withdraw from this contract within 14 days without giving any reason. The withdrawal period will expire after 14 days from the day on which you acquire, or a third party other than the carrier and indicated by you acquires, physical possession of the last good. You may use the attached model withdrawal form, but it is not obligatory. To meet the withdrawal deadline, it is sufficient for you to send your communication concerning your exercise of the right of withdrawal before the withdrawal period has expired.","Sie haben das Recht, binnen vierzehn Tagen ohne Angabe von Gründen diesen Vertrag zu widerrufen. Die Widerrufsfrist beträgt vierzehn Tage ab dem Tag, an dem Sie oder ein von Ihnen benannter Dritter, der nicht der Beförderer ist, die letzte Ware in Besitz genommen hat. Sie können dafür das beigefügte Muster-Widerrufsformular verwenden, das jedoch nicht vorgeschrieben ist. Zur Wahrung der Widerrufsfrist reicht es aus, dass Sie die Mitteilung über die Ausübung des Widerrufsrechts vor Ablauf der Widerrufsfrist absenden.","

Spryker Systems GmbH

Julie-Wolfthorn-Straße 1
10115 Berlin
DE

Phone: +49 (30) 2084983 50
Email: info@spryker.com

Represented by
Managing Directors: Alexander Graf, Boris Lokschin
Register Court: Hamburg
Register Number: HRB 134310

","

Spryker Systems GmbH

Julie-Wolfthorn-Straße 1
10115 Berlin
DE

Phone: +49 (30) 2084983 50
Email: info@spryker.com

Vertreten durch
Geschäftsführer: Alexander Graf, Boris Lokschin
Registergericht: Hamburg
Registernummer: HRB 134310

",Spryker Systems GmbH values the privacy of your personal data.,Für die Abwicklung ihrer Bestellung gelten auch die Datenschutzbestimmungen von Spryker Systems GmbH.,1,+49 30 234567800 +MER000002,Country Manager DE,Ms,Martha,Farmer,+31 123 345 678,https://d2s0ynfc62ej12.cloudfront.net/merchant/videoking-banner.png,https://d2s0ynfc62ej12.cloudfront.net/merchant/videoking-logo.png,hi@video-king.nl,+31 123 345 777,"Video King is a premium provider of video equipment. In business since 2010, we understand the needs of video professionals and enthusiasts and offer a wide variety of products with competitive prices. ","Video King ist ein Premium-Anbieter von Videogeräten. Wir sind seit 2010 im Geschäft, verstehen die Bedürfnisse von Videoprofis und -enthusiasten und bieten eine große Auswahl an Produkten zu wettbewerbsfähigen Preisen an. ",https://d2s0ynfc62ej12.cloudfront.net/merchant/videoking-banner.png,https://d2s0ynfc62ej12.cloudfront.net/merchant/videoking-banner.png,2-4 days,2-4 Tage,"

General Terms

(1) This privacy policy has been compiled to better serve those who are concerned with how their 'Personally identifiable information' (PII) is being used online. PII, as used in US privacy law and information security, is information that can be used on its own or with other information to identify, contact, or locate a single person, or to identify an individual in context. Please read our privacy policy carefully to get a clear understanding of how we collect, use, protect or otherwise handle your Personally Identifiable Information in accordance with our website.

(2) We do not collect information from visitors of our site or other details to help you with your experience.

Using your Information

We may use the information we collect from you when you register, make a purchase, sign up for our newsletter, respond to a survey or marketing communication, surf the website, or use certain other site features in the following ways:

To personalize user's experience and to allow us to deliver the type of content and product offerings in which you are most interested.

Protecting visitor information

Our website is scanned on a regular basis for security holes and known vulnerabilities in order to make your visit to our site as safe as possible. Your personal information is contained behind secured networks and is only accessible by a limited number of persons who have special access rights to such systems, and are required to keep the information confidential. In addition, all sensitive/credit information you supply is encrypted via Secure Socket Layer (SSL) technology.

","

§ 1 Geltungsbereich & Abwehrklausel

(1) Für die über diesen Internet-Shop begründeten Rechtsbeziehungen zwischen dem Betreiber des Shops (nachfolgend „Anbieter“) und seinen Kunden gelten ausschließlich die folgenden Allgemeinen Geschäftsbedingungen in der jeweiligen Fassung zum Zeitpunkt der Bestellung.

(2) Abweichende Allgemeine Geschäftsbedingungen des Kunden werden zurückgewiesen.

§ 2 Zustandekommen des Vertrages

(1) Die Präsentation der Waren im Internet-Shop stellt kein bindendes Angebot des Anbieters auf Abschluss eines Kaufvertrages dar. Der Kunde wird hierdurch lediglich aufgefordert, durch eine Bestellung ein Angebot abzugeben.

(2) Durch das Absenden der Bestellung im Internet-Shop gibt der Kunde ein verbindliches Angebot gerichtet auf den Abschluss eines Kaufvertrages über die im Warenkorb enthaltenen Waren ab. Mit dem Absenden der Bestellung erkennt der Kunde auch diese Geschäftsbedingungen als für das Rechtsverhältnis mit dem Anbieter allein maßgeblich an.

(3) Der Anbieter bestätigt den Eingang der Bestellung des Kunden durch Versendung einer Bestätigungs-Email. Diese Bestellbestätigung stellt noch nicht die Annahme des Vertragsangebotes durch den Anbieter dar. Sie dient lediglich der Information des Kunden, dass die Bestellung beim Anbieter eingegangen ist. Die Erklärung der Annahme des Vertragsangebotes erfolgt durch die Auslieferung der Ware oder eine ausdrückliche Annahmeerklärung.

§ 3 Eigentumsvorbehalt

Die gelieferte Ware verbleibt bis zur vollständigen Bezahlung im Eigentum des Anbieters.

§ 4 Fälligkeit

Die Zahlung des Kaufpreises ist mit Vertragsschluss fällig.

","You have the right to withdraw from this contract within 14 days without giving any reason. The withdrawal period will expire after 14 days from the day on which you acquire, or a third party other than the carrier and indicated by you acquires, physical possession of the last good. You may use the attached model withdrawal form, but it is not obligatory. To meet the withdrawal deadline, it is sufficient for you to send your communication concerning your exercise of the right of withdrawal before the withdrawal period has expired.","Sie haben das Recht, binnen vierzehn Tagen ohne Angabe von Gründen diesen Vertrag zu widerrufen. Die Widerrufsfrist beträgt vierzehn Tage ab dem Tag, an dem Sie oder ein von Ihnen benannter Dritter, der nicht der Beförderer ist, die letzte Ware in Besitz genommen hat. Sie können dafür das beigefügte Muster-Widerrufsformular verwenden, das jedoch nicht vorgeschrieben ist. Zur Wahrung der Widerrufsfrist reicht es aus, dass Sie die Mitteilung über die Ausübung des Widerrufsrechts vor Ablauf der Widerrufsfrist absenden.",

Video King

Gilzeweg 24
4854SG Bavel
NL

Phone: +31 123 45 6789
Email: hi@video-king.nl

Represented by
Managing Director: Max Mustermann
Register Court: Amsterdam
Register Number: 1234.4567

,

Video King

Gilzeweg 24
4854SG Bavel
NL

Telefon: +31 123 45 6789
Email: hi@video-king.nl

Vertreten durch
Geschäftsführer: Max Mustermann
Registergericht: Amsterdam
Registernummer: 1234.4567

,Video King values the privacy of your personal data.,Für die Abwicklung ihrer Bestellung gelten auch die Datenschutzbestimmungen von Video King.,1,+31 123 345 733 +MER000006,Brand Manager,Ms,Michele,Nemeth,030/123456789,https://d2s0ynfc62ej12.cloudfront.net/merchant/sonyexperts-banner.png,https://d2s0ynfc62ej12.cloudfront.net/merchant/sonyexperts-logo.png,support@sony-experts.com,+49 30 234567691,"Capture your moment with the best cameras from Sony. From pocket-size to professional-style, they all pack features to deliver the best quality pictures. +Discover the range of Sony cameras, lenses and accessories, and capture your favorite moments with precision and style with the best cameras can offer.","Halten Sie Ihren Moment mit den besten Kameras von Sony fest. Vom Taschenformat bis hin zum professionellen Stil bieten sie alle Funktionen, um Bilder in bester Qualität zu liefern. +Entdecken Sie das Angebot an Kameras, Objektiven und Zubehör von Sony und fangen Sie Ihre Lieblingsmomente mit Präzision und Stil mit den besten Kameras ein, die das Unternehmen zu bieten hat.",https://d2s0ynfc62ej12.cloudfront.net/merchant/sonyexperts-banner.png,https://d2s0ynfc62ej12.cloudfront.net/merchant/sonyexperts-banner.png,1-3 days,1-3 Tage,"

General Terms

(1) This privacy policy has been compiled to better serve those who are concerned with how their 'Personally identifiable information' (PII) is being used online. PII, as used in US privacy law and information security, is information that can be used on its own or with other information to identify, contact, or locate a single person, or to identify an individual in context. Please read our privacy policy carefully to get a clear understanding of how we collect, use, protect or otherwise handle your Personally Identifiable Information in accordance with our website.

(2) We do not collect information from visitors of our site or other details to help you with your experience.

Using your Information

We may use the information we collect from you when you register, make a purchase, sign up for our newsletter, respond to a survey or marketing communication, surf the website, or use certain other site features in the following ways:

To personalize user's experience and to allow us to deliver the type of content and product offerings in which you are most interested.

Protecting visitor information

Our website is scanned on a regular basis for security holes and known vulnerabilities in order to make your visit to our site as safe as possible. Your personal information is contained behind secured networks and is only accessible by a limited number of persons who have special access rights to such systems, and are required to keep the information confidential. In addition, all sensitive/credit information you supply is encrypted via Secure Socket Layer (SSL) technology.

","

§ 1 Geltungsbereich & Abwehrklausel

(1) Für die über diesen Internet-Shop begründeten Rechtsbeziehungen zwischen dem Betreiber des Shops (nachfolgend „Anbieter“) und seinen Kunden gelten ausschließlich die folgenden Allgemeinen Geschäftsbedingungen in der jeweiligen Fassung zum Zeitpunkt der Bestellung.

(2) Abweichende Allgemeine Geschäftsbedingungen des Kunden werden zurückgewiesen.

§ 2 Zustandekommen des Vertrages

(1) Die Präsentation der Waren im Internet-Shop stellt kein bindendes Angebot des Anbieters auf Abschluss eines Kaufvertrages dar. Der Kunde wird hierdurch lediglich aufgefordert, durch eine Bestellung ein Angebot abzugeben.

(2) Durch das Absenden der Bestellung im Internet-Shop gibt der Kunde ein verbindliches Angebot gerichtet auf den Abschluss eines Kaufvertrages über die im Warenkorb enthaltenen Waren ab. Mit dem Absenden der Bestellung erkennt der Kunde auch diese Geschäftsbedingungen als für das Rechtsverhältnis mit dem Anbieter allein maßgeblich an.

(3) Der Anbieter bestätigt den Eingang der Bestellung des Kunden durch Versendung einer Bestätigungs-Email. Diese Bestellbestätigung stellt noch nicht die Annahme des Vertragsangebotes durch den Anbieter dar. Sie dient lediglich der Information des Kunden, dass die Bestellung beim Anbieter eingegangen ist. Die Erklärung der Annahme des Vertragsangebotes erfolgt durch die Auslieferung der Ware oder eine ausdrückliche Annahmeerklärung.

§ 3 Eigentumsvorbehalt

Die gelieferte Ware verbleibt bis zur vollständigen Bezahlung im Eigentum des Anbieters.

§ 4 Fälligkeit

Die Zahlung des Kaufpreises ist mit Vertragsschluss fällig.

","You have the right to withdraw from this contract within 14 days without giving any reason. The withdrawal period will expire after 14 days from the day on which you acquire, or a third party other than the carrier and indicated by you acquires, physical possession of the last good. You may use the attached model withdrawal form, but it is not obligatory. To meet the withdrawal deadline, it is sufficient for you to send your communication concerning your exercise of the right of withdrawal before the withdrawal period has expired.","Sie haben das Recht, binnen vierzehn Tagen ohne Angabe von Gründen diesen Vertrag zu widerrufen. Die Widerrufsfrist beträgt vierzehn Tage ab dem Tag, an dem Sie oder ein von Ihnen benannter Dritter, der nicht der Beförderer ist, die letzte Ware in Besitz genommen hat. Sie können dafür das beigefügte Muster-Widerrufsformular verwenden, das jedoch nicht vorgeschrieben ist. Zur Wahrung der Widerrufsfrist reicht es aus, dass Sie die Mitteilung über die Ausübung des Widerrufsrechts vor Ablauf der Widerrufsfrist absenden.",

Sony Experts

Matthias-Pschorr-Straße 1
80336 München
DE

Phone: 030 1234567
Email: support@sony-experts.com

Represented by
Managing Director: Max Mustermann
Register Court: Munich
Register Number: HYY 134306

,

Sony Experts

Matthias-Pschorr-Straße 1
80336 München
DE

Phone: 030 1234567
Email: support@sony-experts.com

Vertreten durch
Geschäftsführer: Max Mustermann
Registergericht: München
Registernummer: HYY 134306

,Sony Experts values the privacy of your personal data.,Für die Abwicklung ihrer Bestellung gelten auch die Datenschutzbestimmungen von Sony Experts.,1,+49 30 234567600 +MER000004,,,,,,,,,,,,,,,,,,,,,,,,0, +MER000003,,,,,,,,,,,,,,,,,,,,,,,,0, +MER000007,,,,,,,,,,,,,,,,,,,,,,,,0, +MER000005,Merchandise Manager,Mr,Jason,Weidmann,030/123456789,https://d2s0ynfc62ej12.cloudfront.net/merchant/budgetcameras-banner.png,https://d2s0ynfc62ej12.cloudfront.net/merchant/budgetcameras-logo.png,support@budgetcamerasonline.com,+49 30 234567591,"DSLR and mirrorless cameras are by far the most popular with filmmakers on a tight budget when you can't afford multiple specialist cameras. +Budget Cameras is offering a great selection of digital cameras with the lowest prices.","DSLR- und spiegellose Kameras sind bei Filmemachern mit knappem Budget bei weitem am beliebtesten, wenn sie sich bestimmte Spezialkameras nicht leisten können. +Budget Cameras bietet eine große Auswahl an Digitalkameras mit den niedrigsten Preisen.",https://d2s0ynfc62ej12.cloudfront.net/merchant/budgetcameras-banner.png,https://d2s0ynfc62ej12.cloudfront.net/merchant/budgetcameras-banner.png,2-4 days,2-4 Tage,"

General Terms

(1) This privacy policy has been compiled to better serve those who are concerned with how their 'Personally identifiable information' (PII) is being used online. PII, as used in US privacy law and information security, is information that can be used on its own or with other information to identify, contact, or locate a single person, or to identify an individual in context. Please read our privacy policy carefully to get a clear understanding of how we collect, use, protect or otherwise handle your Personally Identifiable Information in accordance with our website.

(2) We do not collect information from visitors of our site or other details to help you with your experience.

Using your Information

We may use the information we collect from you when you register, make a purchase, sign up for our newsletter, respond to a survey or marketing communication, surf the website, or use certain other site features in the following ways:

To personalize user's experience and to allow us to deliver the type of content and product offerings in which you are most interested.

Protecting visitor information

Our website is scanned on a regular basis for security holes and known vulnerabilities in order to make your visit to our site as safe as possible. Your personal information is contained behind secured networks and is only accessible by a limited number of persons who have special access rights to such systems, and are required to keep the information confidential. In addition, all sensitive/credit information you supply is encrypted via Secure Socket Layer (SSL) technology.

","

§ 1 Geltungsbereich & Abwehrklausel

(1) Für die über diesen Internet-Shop begründeten Rechtsbeziehungen zwischen dem Betreiber des Shops (nachfolgend „Anbieter“) und seinen Kunden gelten ausschließlich die folgenden Allgemeinen Geschäftsbedingungen in der jeweiligen Fassung zum Zeitpunkt der Bestellung.

(2) Abweichende Allgemeine Geschäftsbedingungen des Kunden werden zurückgewiesen.

§ 2 Zustandekommen des Vertrages

(1) Die Präsentation der Waren im Internet-Shop stellt kein bindendes Angebot des Anbieters auf Abschluss eines Kaufvertrages dar. Der Kunde wird hierdurch lediglich aufgefordert, durch eine Bestellung ein Angebot abzugeben.

(2) Durch das Absenden der Bestellung im Internet-Shop gibt der Kunde ein verbindliches Angebot gerichtet auf den Abschluss eines Kaufvertrages über die im Warenkorb enthaltenen Waren ab. Mit dem Absenden der Bestellung erkennt der Kunde auch diese Geschäftsbedingungen als für das Rechtsverhältnis mit dem Anbieter allein maßgeblich an.

(3) Der Anbieter bestätigt den Eingang der Bestellung des Kunden durch Versendung einer Bestätigungs-Email. Diese Bestellbestätigung stellt noch nicht die Annahme des Vertragsangebotes durch den Anbieter dar. Sie dient lediglich der Information des Kunden, dass die Bestellung beim Anbieter eingegangen ist. Die Erklärung der Annahme des Vertragsangebotes erfolgt durch die Auslieferung der Ware oder eine ausdrückliche Annahmeerklärung.

§ 3 Eigentumsvorbehalt

Die gelieferte Ware verbleibt bis zur vollständigen Bezahlung im Eigentum des Anbieters.

§ 4 Fälligkeit

Die Zahlung des Kaufpreises ist mit Vertragsschluss fällig.

","You have the right to withdraw from this contract within 14 days without giving any reason. The withdrawal period will expire after 14 days from the day on which you acquire, or a third party other than the carrier and indicated by you acquires, physical possession of the last good. You may use the attached model withdrawal form, but it is not obligatory. To meet the withdrawal deadline, it is sufficient for you to send your communication concerning your exercise of the right of withdrawal before the withdrawal period has expired.","Sie haben das Recht, binnen vierzehn Tagen ohne Angabe von Gründen diesen Vertrag zu widerrufen. Die Widerrufsfrist beträgt vierzehn Tage ab dem Tag, an dem Sie oder ein von Ihnen benannter Dritter, der nicht der Beförderer ist, die letzte Ware in Besitz genommen hat. Sie können dafür das beigefügte Muster-Widerrufsformular verwenden, das jedoch nicht vorgeschrieben ist. Zur Wahrung der Widerrufsfrist reicht es aus, dass Sie die Mitteilung über die Ausübung des Widerrufsrechts vor Ablauf der Widerrufsfrist absenden.",

Budget Cameras

Spitalerstraße 3
20095 Hamburg
DE

Phone: 030 1234567
Email: support@budgetcamerasonline.com

Represented by
Managing Director: Max Mustermann
Register Court: Hamburg
Register Number: HXX 134305

,

Budget Cameras

Spitalerstraße 3
20095 Hamburg
DE

Phone: 030 1234567
Email: support@budgetcamerasonline.com

Vertreten durch
Geschäftsführer: Max Mustermann
Registergericht: Hamburg
Registernummer: HXX 134305

,Budget Cameras values the privacy of your personal data.,Für die Abwicklung ihrer Bestellung gelten auch die Datenschutzbestimmungen von Budget Cameras.,1,+49 30 234567500 +``` + +
+ +| COLUMN | REQUIRED | DATA TYPE | DATA EXAMPLE | DATA EXPLANATION | +|----------------------------------------|----------|-----------|---------------------------------|---------------------------------------------------------------------------| +| merchant_reference | ✓ | String | MER000007 | Merchant identifier. | +| contact_person_role | | String | E-Commerce Manager | Role of the contact person of a merchant. | +| contact_person_title | | String | Mr | The title shown for the contact person of a merchant. | +| contact_person_first_name | | String | Harald | First name of the contact person of a merchant. | +| contact_person_last_name | | String | Schmidt | Last name of the contact person of a merchant. | +| contact_person_phone | | String | 030 234567891a | Phone number of the contact person of a merchant. | +| banner_url | | String | `http://cdn-link/banner.png` | Default banner URL of a merchant if a locale specific one does not exist. | +| logo_url | | String | `http://cdn-link/logo.png` | Logo URL of a merchant. | +| public_email | | String | `email@merchant-domain.com` | Public email for communication of a merchant. | +| public_phone | | String | 030 234567891 | Public phone for communication of a merchant. | +| description_glossary_key.en_US | | String | Lorem ipsum dolor sit amet | Description of a merchant in the en_US locale. | +| description_glossary_key.de_DE | | String | Lorem ipsum dolor sit amet | Description of a merchant in the de_DE locale. | +| banner_url_glossary_key.en_US | | String | `http://cdn-link/en-banner.png` | Locale specific banner URL of a merchant. | +| banner_url_glossary_key.de_DE | | String | `http://cdn-link/en-banner.png` | Locale specific banner URL of a merchant. | +| delivery_time_glossary_key.en_US | | String | 1-3 days | Average delivery time of a merchant in the en_US locale. | +| delivery_time_glossary_key.de_DE | | String | 1-3 days | Average delivery time of a merchant in the de_DE locale. | +| terms_conditions_glossary_key.en_US | | String | Lorem ipsum dolor sit amet | Terms and conditions of a merchant in the en_US locale. | +| terms_conditions_glossary_key.de_DE | | String | Lorem ipsum dolor sit amet | Terms and conditions of a merchant in the de_DE locale. | +| cancellation_policy_glossary_key.en_US | | String | Lorem ipsum dolor sit amet | Cancellation policy of a merchant in the en_US locale. | +| cancellation_policy_glossary_key.de_DE | | String | Lorem ipsum dolor sit amet | Cancellation policy of a merchant in the de_DE locale. | +| imprint_glossary_key.en_US | | String | Lorem ipsum dolor sit amet | Imprint of a merchant in the en_US locale. | +| imprint_glossary_key.de_DE | | String | Lorem ipsum dolor sit amet | Imprint of a merchant in the de_DE locale. | +| data_privacy_glossary_key.en_US | | String | Lorem ipsum dolor sit amet | Data privacy statement of a merchant in the en_US locale. | +| data_privacy_glossary_key.de_DE | | String | Lorem ipsum dolor sit amet | Data privacy statement of a merchant in the de_DE locale. | +| fax_number | | String | 030 234567800 | Fax number of a merchant. | + +2. Prepare merchant profile address data according to your requirements using the demo data: + +**/data/import/common/common/marketplace/merchant_profile_address.csv** + +```csv +merchant_reference,country_iso2_code,country_iso3_code,address1,address2,address3,city,zip_code,longitude,latitude +MER000001,DE,DEU,Julie-Wolfthorn-Straße,1,,Berlin,10115,52.534105,13.384458 +MER000002,NL,,Gilzeweg,24,,Bavel,4854SG,51.558107,4.838470 +MER000006,DE,DEU,Matthias-Pschorr-Straße,1,,München,80336,48.131058,11.547788 +MER000005,DE,DEU,Spitalerstraße,3,,Berlin,10115,, +MER000004,DE,DEU,Caroline-Michaelis-Straße,8,,Hamburg,20095,, +MER000003,DE,DEU,Caroline-Michaelis-Straße,8,,Berlin,10115,, +MER000007,DE,DEU,Caroline-Michaelis-Straße,8,,Berlin,10115,53.552463,10.004663 +``` + +| COLUMN | REQUIRED | DATA TYPE | DATA EXAMPLE | DATA EXPLANATION | +|--------------------|----------|-----------|---------------------------|-------------------------------------------| +| merchant_reference | ✓ | String | MER000006 | Merchant identifier. | +| country_iso2_code | | String | DE | Country ISO-2 code the address exists in. | +| country_iso3_code | | String | DEU | Country ISO-3 code the address exists in. | +| address1 | | String | Caroline-Michaelis-Straße | Address line 1 of a merchant. | +| address2 | | String | 8 | Address line 2 of a merchant. | +| address3 | | String | Second floor | Address line 3 of a merchant. | +| city | | String | Berlin | City address of a merchant. | +| zip_code | | String | 10115 | Zip code address of a merchant. | +| longitude | | String | 52.534105 | Longitude value of a merchant. | +| latitude | | String | 13.384458 | Latitude value of a merchant. | + +3. Register the following plugins to enable data import: + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|----------------------------------------|----------------------------------------------------------|---------------|------------------------------------------------------------| +| MerchantProfileDataImportPlugin | Imports merchant profile data into the database. | | Spryker\Zed\MerchantProfileDataImport\Communication\Plugin | +| MerchantProfileAddressDataImportPlugin | Imports merchant profile address data into the database. | | Spryker\Zed\MerchantProfileDataImport\Communication\Plugin | + +**src/Pyz/Zed/DataImport/DataImportDependencyProvider.php** + +```php + +src/Pyz/Zed/DataImport/Business/Model/MerchantUser/MerchantUserWriterStep.php + +```php +merchantUserFacade = $merchantUserFacade; + } + + protected const MERCHANT_REFERENCE = 'merchant_reference'; + protected const USERNAME = 'username'; + + /** + * @inheritDoc + */ + public function execute(DataSetInterface $dataSet): void + { + $idMerchant = $this->getIdMerchantByReference($dataSet[static::MERCHANT_REFERENCE]); + $idUser = $this->getIdUserByUsername($dataSet[static::USERNAME]); + + $merchantUserTransfer = $this->merchantUserFacade->findMerchantUser( + (new MerchantUserCriteriaTransfer()) + ->setIdUser($idUser) + ->setIdMerchant($idMerchant) + ); + + if (!$merchantUserTransfer) { + $userTransfer = $this->merchantUserFacade->findUser( + (new UserCriteriaTransfer())->setIdUser($idUser) + ); + + $this->merchantUserFacade->createMerchantUser( + (new MerchantUserTransfer()) + ->setIdMerchant($idMerchant) + ->setUser($userTransfer) + ); + } + } + + /** + * @param string $merchantReference + * + * @throws \Pyz\Zed\DataImport\Business\Exception\EntityNotFoundException + * + * @return int + */ + protected function getIdMerchantByReference(string $merchantReference): int + { + $merchantEntity = SpyMerchantQuery::create() + ->findOneByMerchantReference($merchantReference); + + if (!$merchantEntity) { + throw new EntityNotFoundException(sprintf('Merchant with reference "%s" is not found.', $merchantReference)); + } + + return $merchantEntity->getIdMerchant(); + } + + /** + * @param string $username + * + * @throws \Pyz\Zed\DataImport\Business\Exception\EntityNotFoundException + * + * @return int + */ + protected function getIdUserByUsername(string $username): int + { + $userEntity = SpyUserQuery::create() + ->findOneByUsername($username); + + if (!$userEntity) { + throw new EntityNotFoundException(sprintf('User with username "%s" is not found.', $username)); + } + + return $userEntity->getIdUser(); + } +} +``` + + + +3. Optional: Add the merchant user import type to full import: + +**src/Pyz/Zed/DataImport/DataImportConfig.php** + +```php + + */ + public function getFullImportTypes(): array + { + return [ + static::IMPORT_TYPE_MERCHANT_USER, + ]; + } +} +``` + +4. Enable the merchant user data import command: + +
+src/Pyz/Zed/DataImport/Business/DataImportBusinessFactory.php + +```php +getDataEntity()) { + case DataImportConfig::IMPORT_TYPE_MERCHANT_USER: + return $this->createMerchantUserImporter($dataImportConfigurationActionTransfer); + default: + return null; + } + } + + /** + * @param \Generated\Shared\Transfer\DataImportConfigurationActionTransfer $dataImportConfigurationActionTransfer + * + * @return \Spryker\Zed\DataImport\Business\Model\DataImporterInterface + */ + public function createMerchantUserImporter(DataImportConfigurationActionTransfer $dataImportConfigurationActionTransfer) + { + $dataImporter = $this->getCsvDataImporterFromConfig( + $this->getConfig()->buildImporterConfigurationByDataImportConfigAction($dataImportConfigurationActionTransfer) + ); + + $dataSetStepBroker = $this->createTransactionAwareDataSetStepBroker(); + $dataSetStepBroker->addStep(new MerchantUserWriterStep( + $this->getMerchantUserFacade() + )); + + $dataImporter->addDataSetStepBroker($dataSetStepBroker); + + return $dataImporter; + } + + /** + * @return \Spryker\Zed\MerchantUser\Business\MerchantUserFacadeInterface + */ + protected function getMerchantUserFacade(): MerchantUserFacadeInterface + { + return $this->getProvidedDependency(DataImportDependencyProvider::FACADE_MERCHANT_USER); + } +} +``` + +
+ +5. Create and prepare your data import configuration files according to your requirements using the demo config template: + +**data/import/common/marketplace_import_config_EU.yml** + +```yml +version: 0 + +actions: + - data_entity: merchant-user + source: data/import/common/common/merchant_user.csv + - data_entity: merchant-profile + source: data/import/common/common/marketplace/merchant_profile.csv + - data_entity: merchant-profile-address + source: data/import/common/common/marketplace/merchant_profile_address.csv + ``` + +6. Import data: + +```bash +console data:import merchant-user +``` + +{% info_block warningBox "Verification" %} + +Make sure the data has been added to the following tables: +* `spy_merchant_profile` +* `spy_merchant_profile_address` +* `spy_merchant_user` + +{% endinfo_block %} + +## Install feature frontend + +Follow the steps below to install the Marketplace Merchant feature frontend. + +### Prerequisites + +Install the required features: + +| NAME | VERSION | INSTALLATION GUIDE | +|--------------|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Spryker Core | {{page.version}} | [Install the Spryker Core feature](/docs/pbc/all/miscellaneous/{{page.version}}/install-and-upgrade/install-features/install-the-spryker-core-feature.html) | + +### 1) Install the required modules using Composer + +```bash +composer require spryker-feature/marketplace-merchant: "{{page.version}}" --update-with-dependencies +``` + +{% info_block warningBox "Verification" %} + +Make sure that the following modules have been installed: + +| MODULE | EXPECTED DIRECTORY | +|-----------------------|---------------------------------------------| +| MerchantProfileWidget | vendor/spryker-shop/merchant-profile-widget | +| MerchantWidget | vendor/spryker-shop/merchant-widget | +| MerchantPage | vendor/spryker-shop/merchant-page | + +{% endinfo_block %} + + +### 2) Add translations + +Add Yves translations: + +1. Append glossary according to your configuration: + +**data/import/common/common/glossary.csv** + +```csv +merchant.sold_by,Sold by,en_US +merchant.sold_by,Verkauft durch,de_DE +merchant_profile.email,Email Address,en_US +merchant_profile.email,Email,de_DE +merchant_profile.address,Address,en_US +merchant_profile.address,Adresse,de_DE +merchant_profile.phone,Phone,en_US +merchant_profile.phone,Telefon,de_DE +merchant_profile.terms_and_conditions,Terms & Conditions,en_US +merchant_profile.terms_and_conditions,AGB,de_DE +merchant_profile.cancellation_policy,Cancellation Policy,en_US +merchant_profile.cancellation_policy,Widerrufsbelehrung,de_DE +merchant_profile.imprint,Imprint,en_US +merchant_profile.imprint,Impressum,de_DE +merchant_profile.privacy,Data Privacy,en_US +merchant_profile.privacy,Datenschutz,de_DE +merchant_profile.delivery_time,Delivery Time,en_US +merchant_profile.delivery_time,Lieferzeit,de_DE +``` + +2. Import data: + +```bash +console data:import glossary +``` + +{% info_block warningBox "Verification" %} + +Make sure that the configured data has been added to the `spy_glossary_key` and `spy_glossary_translation` tables. + +{% endinfo_block %} + +### 3) Set up widgets + +1. Register the following plugins to enable widgets: + +| PLUGIN | DESCRIPTION | PREREQUISITES | NAMESPACE | +|----------------------|------------------------------------------------------------------------|---------------|----------------------------------------| +| SoldByMerchantWidget | Shows the list of the offers with their prices for a concrete product. | | SprykerShop\Yves\MerchantWidget\Widget | + +**src/Pyz/Yves/ShopApplication/ShopApplicationDependencyProvider.php** + +```php + + */ + protected function getGlobalWidgets(): array + { + return [ + SoldByMerchantWidget::class, + ]; + } +} +``` + +2. Enable Javascript and CSS changes: + +```bash +console frontend:yves:build +``` + +{% info_block warningBox "Verification" %} + +To verify `SoldByMerchantWidget` has been registered, make sure the **Sold by merchant:** section is displayed on the Product Details pages. This also requires the [Marketplace Product feature to be installed](/docs/pbc/all/product-information-management/{{page.version}}/marketplace/install-and-upgrade/install-features/install-the-marketplace-product-feature.html). + +{% endinfo_block %} + +### 4) Set up behavior + +1. Enable the following behaviors by registering the plugins: + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|-----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|---------------------------------------| +| MerchantPageResourceCreatorPlugin | Allows accessing a merchant page at `https://mysprykershop.com/merchant/{merchantReference}`. | | SprykerShop\Yves\MerchantPage\Plugin | +| UrlStorageMerchantMapperPlugin | Provides access to merchant storage data in the controller related to the `https://mysprykershop.com/merchant/{merchantReference}` URL. | Publish URL storage data to Redis by running `console sync:data url`. | Spryker\Client\MerchantStorage\Plugin | + +**src/Pyz/Yves/StorageRouter/StorageRouterDependencyProvider.php** + +```php + + */ + protected function getResourceCreatorPlugins(): array + { + return [ + new MerchantPageResourceCreatorPlugin(), + ]; + } +} +``` + +**src/Pyz/Client/UrlStorage/UrlStorageDependencyProvider.php** + +```php + + */ + protected function getUrlStorageResourceMapperPlugins() + { + return [ + new UrlStorageMerchantMapperPlugin(), + ]; + } +} +``` + +{% info_block warningBox "Verification" %} + +Make sure the merchant page is accessible at `https://mysprykershop/de/merchant/spryker`. + +{% endinfo_block %} + +2. Enable Javascript and CSS changes: + +```bash +console frontend:yves:build +``` + +{% info_block warningBox "Verification" %} + +Make sure merchant profile data is displayed at `https://mysprykershop.com/de/merchant/spryker`. + +{% endinfo_block %} + +## Install related features + +| FEATURE | REQUIRED FOR THE CURRENT FEATURE | INSTALLATION GUIDE | +|--------------------------|----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Marketplace Merchant API | ✓ | [Install the Marketplace Merchant feature ](/docs/pbc/all/merchant-management/{{page.version}}/marketplace/install-and-upgrade/install-glue-api/install-the-marketplace-merchant-glue-api.html) | diff --git a/_includes/pbc/all/install-features/202403.0/unified-commerce/install-the-warehouse-user-management-feature.md b/_includes/pbc/all/install-features/202403.0/unified-commerce/install-the-warehouse-user-management-feature.md new file mode 100644 index 00000000000..ade59243124 --- /dev/null +++ b/_includes/pbc/all/install-features/202403.0/unified-commerce/install-the-warehouse-user-management-feature.md @@ -0,0 +1,729 @@ + +This document describes how to install the Warehouse User Management feature. + + +## Prerequisites + +Install the required features: + +| NAME | VERSION | INSTALLATION GUIDE | +|--------------------------------|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Spryker Core | {{page.version}} | [Install the Spryker Core feature](/docs/pbc/all/miscellaneous/{{page.version}}/install-and-upgrade/install-features/install-the-spryker-core-feature.html) | | +| Spryker Core Back Office | {{page.version}} | [Install the Spryker Core Back Office feature](/docs/scos/dev/feature-integration-guides/{{page.version}}/spryker-core-back-office-feature-integration.html) | +| Inventory Management | {{page.version}} | [Install the Inventory Management feature](/docs/pbc/all/warehouse-management-system/{{page.version}}/base-shop/install-and-upgrade/install-features/install-the-inventory-management-feature.html) | + +## 1) Install the required modules using Composer + +```bash +composer require spryker-feature/warehouse-user-management: "{{page.version}}" --update-with-dependencies +``` + +{% info_block warningBox "Verification" %} + +Make sure the following modules have been installed: + +| MODULE | EXPECTED DIRECTORY | +|---------------------------|--------------------------------------------| +| OauthWarehouse | vendor/spryker/oauth-warehouse | +| WarehouseOauthBackendApi | vendor/spryker/warehouse-oauth-backend-api | +| WarehouseUser | vendor/spryker/warehouse-user | +| WarehouseUserGui | vendor/spryker/warehouse-user-gui | +| WarehouseUsersBackendApi | vendor/spryker/warehouse-user-backend-api | + +{% endinfo_block %} + +## 2) Set up database schema and transfer objects + +Apply the database changes and generate entity and transfer changes: + +```bash +console propel:install +console transfer:generate +``` + +{% info_block warningBox "Verification" %} + +Make sure the following changes have been applied by checking your database: + +| DATABASE ENTITY | TYPE | EVENT | +|-------------------------------|--------|---------| +| spy_warehouse_user_assignment | table | created | +| spy_stock.uuid | column | created | +| spy_user.is_warehouse_user | column | created | +| spy_user.uuid | column | created | + +Make sure the following changes have been triggered in transfer objects: + +| TRANSFER | TYPE | EVENT | PATH | +|-------------------------------------------------|----------|------------|---------------------------------------------------------------------------------------| +| WarehouseUserAssignment | class | created | src/Generated/Shared/Transfer/WarehouseUserAssignmentTransfer | +| WarehouseUserAssignmentCriteria | class | created | src/Generated/Shared/Transfer/WarehouseUserAssignmentCriteriaTransfer | +| WarehouseUserAssignmentConditions | class | created | src/Generated/Shared/Transfer/WarehouseUserAssignmentConditionsTransfer | +| WarehouseUserAssignmentCollection | class | created | src/Generated/Shared/Transfer/WarehouseUserAssignmentCollectionTransfer | +| WarehouseUserAssignmentCollectionRequest | class | created | src/Generated/Shared/Transfer/WarehouseUserAssignmentCollectionRequestTransfer | +| WarehouseUserAssignmentCollectionResponse | class | created | src/Generated/Shared/Transfer/WarehouseUserAssignmentCollectionResponseTransfer | +| WarehouseUserAssignmentCollectionDeleteCriteria | class | created | src/Generated/Shared/Transfer/WarehouseUserAssignmentCollectionDeleteCriteriaTransfer | +| WarehouseIdentifier | class | created | src/Generated/Shared/Transfer/WarehouseIdentifierTransfer | +| GlueRequestWarehouse | class | created | src/Generated/Shared/Transfer/GlueRequestWarehouseTransfer | +| WarehouseUserAssignmentsBackendApiAttributes | class | created | src/Generated/Shared/Transfer/WarehouseUserAssignmentsBackendApiAttributesTransfer | +| WarehousesBackendApiAttributes | class | created | src/Generated/Shared/Transfer/WarehousesBackendApiAttributesTransfer | +| UserCollection | class | created | src/Generated/Shared/Transfer/UserCollectionTransfer | +| UserConditions | class | created | src/Generated/Shared/Transfer/UserConditionsTransfer | +| OauthScope | class | created | src/Generated/Shared/Transfer/OauthScopeTransfer | +| UserIdentifier | class | created | src/Generated/Shared/Transfer/UserIdentifierTransfer | +| AuthorizationRequest | class | created | src/Generated/Shared/Transfer/AuthorizationRequestTransfer | +| GlueRequestUser | class | created | src/Generated/Shared/Transfer/GlueRequestUserTransfer | +| OauthScope | class | created | src/Generated/Shared/Transfer/OauthScopeTransfer | +| User.uuid | property | created | src/Generated/Shared/Transfer/UserTransfer | +| User.isWarehouseUser | property | created | src/Generated/Shared/Transfer/UserTransfer | +| UserCriteria.userConditions | property | created | src/Generated/Shared/Transfer/UserCriteriaTransfer | +| StockCriteriaFilter.uuids | property | created | src/Generated/Shared/Transfer/StockCriteriaFilterTransfer | +| StockCriteriaFilter.stockIds | property | created | src/Generated/Shared/Transfer/StockCriteriaFilterTransfer | +| Collection | class | deprecated | src/Generated/Shared/Transfer/CollectionTransfer | +| UserCriteria.idUser | property | deprecated | src/Generated/Shared/Transfer/UserCriteriaTransfer | +| UserCriteria.email | property | deprecated | src/Generated/Shared/Transfer/UserCriteriaTransfer | +| UserCriteria.userReference | property | deprecated | src/Generated/Shared/Transfer/UserCriteriaTransfer | +| UserCriteria.withExpanders | property | deprecated | src/Generated/Shared/Transfer/UserCriteriaTransfer | +| StockCriteriaFilter.idStock | property | deprecated | src/Generated/Shared/Transfer/StockCriteriaFilterTransfer | + +{% endinfo_block %} + +## 3) Set up configuration + +1. Optional: To make `warehouse-user-assignments` and `warehouse-tokens` resources protected, adjust the protected paths configuration: + +**src/Pyz/Shared/GlueBackendApiApplicationAuthorizationConnector/GlueBackendApiApplicationAuthorizationConnectorConfig.php** + +```php + + */ + public function getProtectedPaths(): array + { + return [ + '/\/warehouse-user-assignments(?:\/[^\/]+)?\/?$/' => [ + 'isRegularExpression' => true, + ], + '/warehouse-tokens' => [ + 'isRegularExpression' => false, + 'methods' => [ + 'post', + ], + ], + ]; + } +} +``` + + +2. Optional: To give warehouse users access to Backend Glue API endpoints, do the following: + + 1. [Integrate Glue authentication](/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-the-authentication.html). + + 2. Specify the list of endpoints which warehouse users have access to: + + +
+ src/Pyz/Zed/OauthWarehouseUser/OauthWarehouseUserConfig.php + +```php + [ + * 'isRegularExpression' => false, + * ], + * '/\/example\/.+/' => [ + * 'isRegularExpression' => true, + * 'methods' => [ + * 'patch', + * 'delete', + * ], + * ], + * ] + * + * @api + * + * @return array + */ + public function getAllowedForWarehouseUserPaths(): array + { + return [ + '/\/picking-lists.*/' => [ + 'isRegularExpression' => true, + ], + '/\/warehouse-user-assignments(?:\/[^\/]+)?\/?$/' => [ + 'isRegularExpression' => true, + ], + '/push-notification-subscriptions' => [ + 'isRegularExpression' => false, + ], + '/warehouse-tokens' => [ + 'isRegularExpression' => false, + 'methods' => [ + 'post', + ], + ], + ]; + } +} +``` + +
+ +## 4) Add translations + +1. Append glossary according to your configuration: + +```csv +warehouse_user_assignment.validation.user_not_found,User not found.,en_US +warehouse_user_assignment.validation.user_not_found,Benutzer nicht gefunden.,de_DE +warehouse_user_assignment.validation.warehouse_not_found,Warehouse not found.,en_US +warehouse_user_assignment.validation.warehouse_not_found,Lager nicht gefunden.,de_DE +warehouse_user_assignment.validation.warehouse_user_assignment_not_found,Warehouse user assignment not found.,en_US +warehouse_user_assignment.validation.warehouse_user_assignment_not_found,Lagerbenutzerzuweisung nicht gefunden.,de_DE +warehouse_user_assignment.validation.too_many_active_warehouse_assignments,User has too many active warehouse assignments.,en_US +warehouse_user_assignment.validation.too_many_active_warehouse_assignments,Dem Benutzer sind zu viele aktive Läger zugewiesen.,de_DE +warehouse_user_assignment.validation.warehouse_user_assignment_already_exists,Warehouse user assignment already exists.,en_US +warehouse_user_assignment.validation.warehouse_user_assignment_already_exists,Lagerbenutzerzuweisung existiert bereits.,de_DE +``` + +2. Import data: + +```bash +console data:import glossary +``` + +3. To add Zed translations, generate a new translation cache for Zed: + +```bash +console translator:generate-cache +``` + +{% info_block warningBox "Verification" %} + +* Make sure the configured data has been added to the `spy_glossary_key` and `spy_glossary_translation` tables. +* Verify that the translation cache has been built: + 1. In the Back Office, go to **Users > Users**. + 2. For a user of your choice, click **Assign Warehouses**. + Make sure that the **Warehouse User Assignment** table is translatable. + +* Verify that you can switch the language in the Back Office: + 1. Go to **Users > Users**. + 2. For a user of your choice, click **Edit**. + The **Edit User: `USER_NAME`** page opens. + 3. For **INTERFACE LANGUAGE**, select another language. + 4. Click **Update**. + Make sure this opens the list of users with a success message displayed. + +{% endinfo_block %} + +## 5) Set up behavior + +1. Enable the following behaviors by registering the plugins: + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|-----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------------------------------------------------------------------------------------------| +| WarehouseUserLoginRestrictionPlugin | Restricts access to the Back office for warehouse users. | | Spryker\Zed\WarehouseUser\Communication\Plugin\SecurityGui | +| WarehouseUserAssignmentUserTableActionExpanderPlugin | Expands the **User** table with the **Assign Warehouses** button. | | Spryker\Zed\WarehouseUserGui\Communication\Plugin\User | +| WarehouseUserAssignmentUserFormExpanderPlugin | Expands the User form with the **is_warehouse_user** checkbox. | | Spryker\Zed\WarehouseUserGui\Communication\Plugin\User | +| WarehouseTokenAuthorizationStrategyPlugin | Checks if the request identity is a valid user and warehouse. | | Spryker\Zed\OauthWarehouse\Communication\Plugin\Authorization | +| OauthWarehouseInstallerPlugin | Installs the warehouse OAuth scope data. | | Spryker\Zed\OauthWarehouse\Communication\Plugin\Installer | +| WarehouseOauthUserProviderPlugin | If `OauthUserTransfer.idWarehouse` is provided, retrieves the warehouse user. If the warehouse user exists, expands `OauthUserTransfer`. | | Spryker\Zed\OauthWarehouse\Communication\Plugin\Oauth | +| WarehouseOauthScopeProviderPlugin | Checks if the grant type is `\Spryker\Zed\OauthWarehouse\OauthWarehouseConfig::WAREHOUSE_GRANT_TYPE`. | | Spryker\Zed\OauthWarehouse\Communication\Plugin\Oauth | +| WarehouseOauthRequestGrantTypeConfigurationProviderPlugin | Checks if the requested OAuth grant type equals to `\Spryker\Zed\OauthWarehouse\OauthWarehouseConfig::WAREHOUSE_GRANT_TYPE` and if the requested application context equals to `GlueBackendApiApplication`. | | Spryker\Zed\OauthWarehouse\Communication\Plugin\Oauth | + +**src/Pyz/Zed/SecurityGui/SecurityGuiDependencyProvider.php** + +```php + + */ + protected function getUserLoginRestrictionPlugins(): array + { + return [ + new WarehouseUserLoginRestrictionPlugin(), + ]; + } +} +``` + +**src/Pyz/Zed/User/UserDependencyProvider.php** + +```php + + */ + protected function getUserTableActionExpanderPlugins(): array + { + return [ + new WarehouseUserAssignmentUserTableActionExpanderPlugin(), + ]; + } + + /** + * @return list<\Spryker\Zed\UserExtension\Dependency\Plugin\UserFormExpanderPluginInterface> + */ + protected function getUserFormExpanderPlugins(): array + { + return [ + new WarehouseUserAssignmentUserFormExpanderPlugin(), + ]; + } +} +``` + +{% info_block warningBox "Verification" %} + +Verify the plugins are set up correctly: + +1. In the Back Office, go to **Users > Users**. +2. Initiate creating a user or editing an existing user. +3. Select the **THIS USER IS A WAREHOUSE USER** checkbox. +4. Create or update the user. + On the **Users** page, make sure that the **Assign Warehouses** button is displayed for the user. +5. Log out from the Back Office. +6. Try to log into the Back Office with the warehouse user's login details. + Make sure you can't log in. + +{% endinfo_block %} + +2. Enable the Backend API authorization for warehouse users by registering the plugins: + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|-----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------------------------------------------------------------------------------------------| +| WarehouseTokenAuthorizationStrategyPlugin | Checks if the request identity is a valid user and warehouse. | | Spryker\Zed\OauthWarehouse\Communication\Plugin\Authorization | +| OauthWarehouseInstallerPlugin | Installs the warehouse OAuth scope data. | | Spryker\Zed\OauthWarehouse\Communication\Plugin\Installer | +| WarehouseOauthUserProviderPlugin | If `OauthUserTransfer.idWarehouse` is provided, retrieves the warehouse user. If the warehouse user exists, expands `OauthUserTransfer`. | | Spryker\Zed\OauthWarehouse\Communication\Plugin\Oauth | +| WarehouseOauthScopeProviderPlugin | Checks if the grant type is `\Spryker\Zed\OauthWarehouse\OauthWarehouseConfig::WAREHOUSE_GRANT_TYPE`. | | Spryker\Zed\OauthWarehouse\Communication\Plugin\Oauth | +| WarehouseOauthRequestGrantTypeConfigurationProviderPlugin | Checks if the requested OAuth grant type equals to `\Spryker\Zed\OauthWarehouse\OauthWarehouseConfig::WAREHOUSE_GRANT_TYPE` and if the requested application context equals to `GlueBackendApiApplication`. | | Spryker\Zed\OauthWarehouse\Communication\Plugin\Oauth | +| WarehouseTokensBackendResourcePlugin | Registers the `warehouse-tokens` resource. | | Spryker\Glue\WarehouseOauthBackendApi\Plugin\GlueBackendApiApplication | +| WarehouseRequestBuilderPlugin | If the warehouse credentials are valid, sets `GlueRequestTransfer.requestWarehouse`. | | Spryker\Glue\WarehouseOauthBackendApi\Plugin\GlueBackendApiApplication | +| WarehouseRequestValidatorPlugin | if a request has the Authorization header, validates if `GlueRequestTransfer.requestWarehouse` is set. | | Spryker\Glue\WarehouseOauthBackendApi\Plugin\GlueBackendApiApplication | +| WarehouseAuthorizationRequestExpanderPlugin | Expands `AuthorizationRequestTransfer.entity` with `GlueRequestWarehouseTransfer`. | | Spryker\Glue\WarehouseOauthBackendApi\Plugin\GlueBackendApiApplicationAuthorizationConnector | +| WarehouseUserRequestValidationPreCheckerPlugin | Checks if `GlueRequestTransfer` has `GlueRequestWarehouseTransfer`. If true, sets `GlueRequestValidationTransfer` as valid. | | Spryker\Glue\WarehouseOauthBackendApi\Plugin\OauthBackendApi | + +
+src/Pyz/Glue/GlueBackendApiApplication/GlueBackendApiApplicationDependencyProvider.php + +```php + + */ + protected function getRequestBuilderPlugins(): array + { + return [ + new UserRequestBuilderPlugin(), + new WarehouseRequestBuilderPlugin(), + ]; + } + + /** + * @return list<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\RequestValidatorPluginInterface> + */ + protected function getRequestValidatorPlugins(): array + { + return [ + new WarehouseRequestValidatorPlugin(), + ]; + } + + /** + * @return list<\Spryker\Glue\GlueApplicationExtension\Dependency\Plugin\ResourceInterface> + */ + protected function getResourcePlugins(): array + { + return [ + new WarehouseTokensBackendResourcePlugin(), + ]; + } +} +``` +
+ +**src/Pyz/Glue/GlueBackendApiApplicationAuthorizationConnector/GlueBackendApiApplicationAuthorizationConnectorDependencyProvider.php** + +```php + + */ + protected function getAuthorizationRequestExpanderPlugins(): array + { + return [ + new WarehouseAuthorizationRequestExpanderPlugin(), + ]; + } +} +``` + +**src/Pyz/Glue/OauthBackendApi/OauthBackendApiDependencyProvider.php** + +```php + + */ + protected function getUserRequestValidationPreCheckerPlugins(): array + { + return [ + new WarehouseUserRequestValidationPreCheckerPlugin(), + ]; + } +} +``` + +**src/Pyz/Zed/Authorization/AuthorizationDependencyProvider.php** + +```php + + */ + protected function getAuthorizationStrategyPlugins(): array + { + return [ + new WarehouseTokenAuthorizationStrategyPlugin(), + ]; + } +} +``` +**src/Pyz/Zed/Installer/InstallerDependencyProvider.php** + +```php + + */ + public function getInstallerPlugins(): array + { + return [ + new OauthWarehouseInstallerPlugin(), + ]; + } +} +``` + +
+src/Pyz/Zed/Oauth/OauthDependencyProvider.php + +```php + + */ + protected function getUserProviderPlugins(): array + { + return [ + new WarehouseOauthUserProviderPlugin(), + ]; + } + + /** + * @return list<\Spryker\Zed\OauthExtension\Dependency\Plugin\OauthScopeProviderPluginInterface> + */ + protected function getScopeProviderPlugins(): array + { + return [ + new WarehouseOauthScopeProviderPlugin(), + ]; + } + + /** + * @return list<\Spryker\Zed\OauthExtension\Dependency\Plugin\OauthRequestGrantTypeConfigurationProviderPluginInterface> + */ + protected function getOauthRequestGrantTypeConfigurationProviderPlugins(): array + { + return [ + new WarehouseOauthRequestGrantTypeConfigurationProviderPlugin(), + ]; + } +} +``` +
+ +{% info_block warningBox "Verification" %} + +1. In the Back Office, go to **Users > Users**. +2. On the **Users** page, for the user of your choice, click **Edit**. +3. On the **Edit User: `{USER}`** page that opens, select **THIS USER IS A WAREHOUSE USER**. +4. Click **Update**. +5. On the **Users** page, for the user you've edited, click **Assign Warehouses**. + This opens the **Assign Warehouse to User: `{USER_NAME}`** page. +6. In the **Select warehouses to assign** tab, for a warehouse of your choice, select **ASSIGN** and click **Save**. +7. Authenticate as the warehouse user using Glue API: + +```json +POST /access-tokens HTTP/1.1 +Host: glue-backend.mysprykershop.com +Content-Type: application/vnd.api+json +Content-Length: 167 +{ + "data": { + "type": "access-tokens", + "attributes": { + "username": "{USERNAME}", + "password": "{PASSWORD}" + }, + "links": { + "self": "https://glue-backend.mysprykershop.com/token" + } + } +} +``` + +9. Generate a warehouse token with the generated token from the previous step: + +```json +POST /warehouse-tokens HTTP/1.1 +Host: glue-backend.mysprykershop.com +Content-Type: application/vnd.api+json +Content-Length: 165 +{ + "data": { + "type": "warehouse-tokens", + "links": { + "self": "https://glue-backend.mysprykershop.com/warehouse-tokens" + } + } +} +``` + +{% endinfo_block %} + +3. Enable the Backend API resource by registering the plugin: + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|-----------------------------------------------|-------------------------------------------------------|---------------|------------------------------------------------------------------------| +| WarehouseUserAssignmentsBackendResourcePlugin | Registers the `warehouse-user-assignments` resource. | | Spryker\Glue\WarehouseUsersBackendApi\Plugin\GlueBackendApiApplication | + +
+src/Pyz/Glue/GlueBackendApiApplication/GlueBackendApiApplicationDependencyProvider.php + +```php + + */ + protected function getResourcePlugins(): array + { + return [ + new WarehouseUserAssignmentsBackendResourcePlugin(), + ]; + } +} +``` + +{% info_block warningBox "Verification" %} + +Make sure you can send the following requests: + +* `GET https://glue-backend.mysprykershop.com/warehouse-user-assignments` +* `GET https://glue-backend.mysprykershop.com/warehouse-user-assignments/{% raw %}{{{% endraw %}warehouse-user-assignments-uuid{% raw %}}{{% endraw %}` +* `POST https://glue-backend.mysprykershop.com/warehouse-user-assignments` + +```json +{ + "data": { + "type": "warehouse-user-assignments", + "attributes": { + "userUuid": {% raw %}{{{% endraw %}user-uuid{% raw %}}}{% endraw %}, + "warehouse": { + "uuid": {% raw %}{{{% endraw %}warehouse-uuid{% raw %}}}{% endraw %}, + }, + "isActive": true + } + } +} +``` + +* `PATCH https://glue-backend.mysprykershop.com/warehouse-user-assignments/{% raw %}{{{% endraw %}warehouse-user-assignments-uuid{% raw %}}{{% endraw %}` + +```json +{ + "data" : { + "type" : "warehouse-user-assignments", + "attributes" : { + "isActive": true + } + } +} +``` + +* `DELETE https://glue-backend.mysprykershop.com/warehouse-user-assignments/{% raw %}{{{% endraw %}warehouse-user-assignments-uuid{% raw %}}{{% endraw %}`. + +{% endinfo_block %} + + +### Optional: Enable Backend API authentication + +1. [Integrate Glue authentication](/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-the-authentication.html). + +2. Registering the plugins: + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|-------------------------------------------------------|---------------------------------------------------|---------------|------------------------------------------------------------------------| +| WarehouseUserTypeOauthScopeAuthorizationCheckerPlugin | Authorizes a user by warehouse user scopes. | | Spryker\Zed\OauthWarehouseUser\Communication\Plugin\OauthUserConnector | +| WarehouseUserTypeOauthScopeProviderPlugin | Provides the OAuth scopes related to warehouse users. | | Spryker\Zed\OauthWarehouseUser\Communication\Plugin\OauthUserConnector | + +**src/Pyz/Zed/OauthUserConnector/OauthUserConnectorDependencyProvider.php** + +```php + + */ + protected function getUserTypeOauthScopeProviderPlugins(): array + { + return [ + new WarehouseUserTypeOauthScopeProviderPlugin(), + ]; + } + + /** + * @return list<\Spryker\Zed\OauthUserConnectorExtension\Dependency\Plugin\UserTypeOauthScopeAuthorizationCheckerPluginInterface> + */ + protected function getUserTypeOauthScopeAuthorizationCheckerPlugins(): array + { + return [ + new WarehouseUserTypeOauthScopeAuthorizationCheckerPlugin(), + ]; + } +} +``` + +{% info_block warningBox "Verification" %} + +To verify the plugins are set up correctly, authenticate as a warehouse user: + +`POST https://glue-backend.mysprykershop.com/token` +```json +{ + "data": { + "type": "token", + "attributes": { + "grant_type": "password", + "username": {% raw %}{{{% endraw %}username{% raw %}}}{% endraw %}, + "password": {% raw %}{{{% endraw %}password{% raw %}}}{% endraw %}, + } + } +} +``` + +Make sure the output contains the 201 response with a valid token. Make sure that the warehouse user can assess only the endpoints specified in **src/Pyz/Zed/OauthWarehouseUser/OauthWarehouseUserConfig.php**. + +{% endinfo_block %} diff --git a/_templates/feature-installation-guide-template.md b/_templates/feature-installation-guide-template.md index feb270a7c0b..c086124bf77 100644 --- a/_templates/feature-installation-guide-template.md +++ b/_templates/feature-installation-guide-template.md @@ -12,7 +12,7 @@ Before you start, check out the formatting templates in [Formatting templates fo This document describes how to install the [Feature Name feature]({link to a respective feature overview}) feature. -## Install feature core +## Install feature core Follow the steps below to install the {Feature Name} feature core. @@ -383,7 +383,7 @@ console setup:init-db **Verification** -Ensure that the {entities} have been added to the `{table_name}` table. +Make sure that the {entities} have been added to the `{table_name}` table. #### Import {DataImporterName} @@ -550,7 +550,7 @@ The verification step often needs to use an example domain, use - "glue.mysprykershop.com" domains according to your requirements.--> -Make sure the following widgets have been registered by adding the respective code snippets to a Twig template: +Verify that the following widgets have been registered by adding the respective code snippets to a Twig template: | WIDGET | VERIFICATION | | -------- | ----------------------------- | diff --git a/docs/pbc/all/cart-and-checkout/202204.0/base-shop/feature-overviews/checkout-feature-overview/checkout-feature-overview.md b/docs/pbc/all/cart-and-checkout/202204.0/base-shop/feature-overviews/checkout-feature-overview/checkout-feature-overview.md index 377d4e067a4..6d3b8dbca0a 100644 --- a/docs/pbc/all/cart-and-checkout/202204.0/base-shop/feature-overviews/checkout-feature-overview/checkout-feature-overview.md +++ b/docs/pbc/all/cart-and-checkout/202204.0/base-shop/feature-overviews/checkout-feature-overview/checkout-feature-overview.md @@ -46,4 +46,4 @@ With order thresholds, you can do the following: | INSTALLATION GUIDES | UPGRADE GUIDES| DATA IMPORT | |---------|---------|---------| | [Install the Checkout feature](/docs/pbc/all/cart-and-checkout/{{site.version}}/base-shop/install-and-upgrade/install-features/install-the-checkout-feature.html) | [Upgrade the Checkout module](/docs/pbc/all/cart-and-checkout/{{site.version}}/base-shop/install-and-upgrade/upgrade-modules/upgrade-the-checkout-module.html) | [File details: sales_order_threshold.csv](/docs/pbc/all/cart-and-checkout/{{site.version}}/base-shop/import-and-export-data/import-file-details-sales-order-threshold.csv.html) | -| [Merchant feature integration](/docs/scos/dev/feature-integration-guides/{{site.version}}/merchant-feature-integration.html) | [Upgrade the CheckoutPage module](/docs/pbc/all/cart-and-checkout/{{site.version}}/base-shop/install-and-upgrade/upgrade-modules/upgrade-the-checkoutpage-module.html) | | +| [Install the Merchant feature](/docs/scos/dev/feature-integration-guides/{{site.version}}/merchant-feature-integration.html) | [Upgrade the CheckoutPage module](/docs/pbc/all/cart-and-checkout/{{site.version}}/base-shop/install-and-upgrade/upgrade-modules/upgrade-the-checkoutpage-module.html) | | diff --git a/docs/pbc/all/cart-and-checkout/202212.0/base-shop/feature-overviews/checkout-feature-overview/checkout-feature-overview.md b/docs/pbc/all/cart-and-checkout/202212.0/base-shop/feature-overviews/checkout-feature-overview/checkout-feature-overview.md index fa22f1803d8..78c111df0ec 100644 --- a/docs/pbc/all/cart-and-checkout/202212.0/base-shop/feature-overviews/checkout-feature-overview/checkout-feature-overview.md +++ b/docs/pbc/all/cart-and-checkout/202212.0/base-shop/feature-overviews/checkout-feature-overview/checkout-feature-overview.md @@ -42,4 +42,4 @@ With order thresholds, you can do the following: | INSTALLATION GUIDES | UPGRADE GUIDES| DATA IMPORT | |---------|---------|---------| | [Install the Checkout feature](/docs/pbc/all/cart-and-checkout/{{site.version}}/base-shop/install-and-upgrade/install-features/install-the-checkout-feature.html) | [Upgrade the Checkout module](/docs/pbc/all/cart-and-checkout/{{site.version}}/base-shop/install-and-upgrade/upgrade-modules/upgrade-the-checkout-module.html) | [File details: sales_order_threshold.csv](/docs/pbc/all/cart-and-checkout/{{site.version}}/base-shop/import-and-export-data/import-file-details-sales-order-threshold.csv.html) | -| [Merchant feature integration](/docs/pbc/all/merchant-management/{{site.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | [Upgrade the CheckoutPage module](/docs/pbc/all/cart-and-checkout/{{site.version}}/base-shop/install-and-upgrade/upgrade-modules/upgrade-the-checkoutpage-module.html) | | +| [Install the Merchant feature](/docs/pbc/all/merchant-management/{{site.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | [Upgrade the CheckoutPage module](/docs/pbc/all/cart-and-checkout/{{site.version}}/base-shop/install-and-upgrade/upgrade-modules/upgrade-the-checkoutpage-module.html) | | diff --git a/docs/pbc/all/cart-and-checkout/202307.0/base-shop/feature-overviews/checkout-feature-overview/checkout-feature-overview.md b/docs/pbc/all/cart-and-checkout/202307.0/base-shop/feature-overviews/checkout-feature-overview/checkout-feature-overview.md index bc05bdfece6..c2940d237a7 100644 --- a/docs/pbc/all/cart-and-checkout/202307.0/base-shop/feature-overviews/checkout-feature-overview/checkout-feature-overview.md +++ b/docs/pbc/all/cart-and-checkout/202307.0/base-shop/feature-overviews/checkout-feature-overview/checkout-feature-overview.md @@ -43,4 +43,4 @@ With order thresholds, you can do the following: | INSTALLATION GUIDES | UPGRADE GUIDES| DATA IMPORT | |---------|---------|---------| | [Install the Checkout feature](/docs/pbc/all/cart-and-checkout/{{site.version}}/base-shop/install-and-upgrade/install-features/install-the-checkout-feature.html) | [Upgrade the Checkout module](/docs/pbc/all/cart-and-checkout/{{site.version}}/base-shop/install-and-upgrade/upgrade-modules/upgrade-the-checkout-module.html) | [File details: sales_order_threshold.csv](/docs/pbc/all/cart-and-checkout/{{site.version}}/base-shop/import-and-export-data/import-file-details-sales-order-threshold.csv.html) | -| [Merchant feature integration](/docs/pbc/all/merchant-management/{{site.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | [Upgrade the CheckoutPage module](/docs/pbc/all/cart-and-checkout/{{site.version}}/base-shop/install-and-upgrade/upgrade-modules/upgrade-the-checkoutpage-module.html) | | +| [Install the Merchant feature](/docs/pbc/all/merchant-management/{{site.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | [Upgrade the CheckoutPage module](/docs/pbc/all/cart-and-checkout/{{site.version}}/base-shop/install-and-upgrade/upgrade-modules/upgrade-the-checkoutpage-module.html) | | diff --git a/docs/pbc/all/merchant-management/202212.0/base-shop/merchant-b2b-contracts-feature-overview.md b/docs/pbc/all/merchant-management/202212.0/base-shop/merchant-b2b-contracts-feature-overview.md index 1a42eded33b..1f615e92d5e 100644 --- a/docs/pbc/all/merchant-management/202212.0/base-shop/merchant-b2b-contracts-feature-overview.md +++ b/docs/pbc/all/merchant-management/202212.0/base-shop/merchant-b2b-contracts-feature-overview.md @@ -46,4 +46,4 @@ Check out this video tutorial on how to set up merchants and merchant relations: |INSTALLATION GUIDES | |---------| | [Merchant B2B Contracts feature integration](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-b2b-contracts-feature.html) | -| [Merchant feature integration](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | +| [Install the Merchant feature](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | diff --git a/docs/pbc/all/merchant-management/202212.0/base-shop/merchant-product-restrictions-feature-overview/merchant-product-restrictions-feature-overview.md b/docs/pbc/all/merchant-management/202212.0/base-shop/merchant-product-restrictions-feature-overview/merchant-product-restrictions-feature-overview.md index 1d429e22946..41d77ac1425 100644 --- a/docs/pbc/all/merchant-management/202212.0/base-shop/merchant-product-restrictions-feature-overview/merchant-product-restrictions-feature-overview.md +++ b/docs/pbc/all/merchant-management/202212.0/base-shop/merchant-product-restrictions-feature-overview/merchant-product-restrictions-feature-overview.md @@ -50,4 +50,4 @@ You can check more cases of product restrictions workflow on the [Restricted Pro | INSTALLATION GUIDES | |---------| | [Merchant B2B Contracts feature integration](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-b2b-contracts-feature.html) | -| [Merchant feature integration](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | +| [Install the Merchant feature](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | diff --git a/docs/pbc/all/merchant-management/202307.0/base-shop/merchant-b2b-contracts-feature-overview.md b/docs/pbc/all/merchant-management/202307.0/base-shop/merchant-b2b-contracts-feature-overview.md index 8f658633b4e..1b765988ecb 100644 --- a/docs/pbc/all/merchant-management/202307.0/base-shop/merchant-b2b-contracts-feature-overview.md +++ b/docs/pbc/all/merchant-management/202307.0/base-shop/merchant-b2b-contracts-feature-overview.md @@ -46,4 +46,4 @@ Check out this video tutorial on how to set up merchants and merchant relations: |INSTALLATION GUIDES | |---------| | [Merchant B2B Contracts feature integration](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-b2b-contracts-feature.html) | -| [Merchant feature integration](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | +| [Install the Merchant feature](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | diff --git a/docs/pbc/all/merchant-management/202307.0/base-shop/merchant-product-restrictions-feature-overview/merchant-product-restrictions-feature-overview.md b/docs/pbc/all/merchant-management/202307.0/base-shop/merchant-product-restrictions-feature-overview/merchant-product-restrictions-feature-overview.md index d3cf7d66267..93fa1241410 100644 --- a/docs/pbc/all/merchant-management/202307.0/base-shop/merchant-product-restrictions-feature-overview/merchant-product-restrictions-feature-overview.md +++ b/docs/pbc/all/merchant-management/202307.0/base-shop/merchant-product-restrictions-feature-overview/merchant-product-restrictions-feature-overview.md @@ -50,4 +50,4 @@ You can check more cases of product restrictions workflow on the [Restricted Pro | INSTALLATION GUIDES | |---------| | [Merchant B2B Contracts feature integration](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-b2b-contracts-feature.html) | -| [Merchant feature integration](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | +| [Install the Merchant feature](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | diff --git a/docs/pbc/all/merchant-management/202311.0/base-shop/merchant-b2b-contracts-feature-overview.md b/docs/pbc/all/merchant-management/202311.0/base-shop/merchant-b2b-contracts-feature-overview.md index 0c9c5ce4aeb..d6ed41f541e 100644 --- a/docs/pbc/all/merchant-management/202311.0/base-shop/merchant-b2b-contracts-feature-overview.md +++ b/docs/pbc/all/merchant-management/202311.0/base-shop/merchant-b2b-contracts-feature-overview.md @@ -46,4 +46,4 @@ Check out this video tutorial on how to set up merchants and merchant relations: |INSTALLATION GUIDES | |---------| | [Merchant B2B Contracts feature integration](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-b2b-contracts-feature.html) | -| [Merchant feature integration](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | +| [Install the Merchant feature](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | diff --git a/docs/pbc/all/merchant-management/202311.0/base-shop/merchant-product-restrictions-feature-overview/merchant-product-restrictions-feature-overview.md b/docs/pbc/all/merchant-management/202311.0/base-shop/merchant-product-restrictions-feature-overview/merchant-product-restrictions-feature-overview.md index d9acde785dc..ecc8846a393 100644 --- a/docs/pbc/all/merchant-management/202311.0/base-shop/merchant-product-restrictions-feature-overview/merchant-product-restrictions-feature-overview.md +++ b/docs/pbc/all/merchant-management/202311.0/base-shop/merchant-product-restrictions-feature-overview/merchant-product-restrictions-feature-overview.md @@ -50,4 +50,4 @@ You can check more cases of product restrictions workflow on the [Restricted Pro | INSTALLATION GUIDES | |---------| | [Merchant B2B Contracts feature integration](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-b2b-contracts-feature.html) | -| [Merchant feature integration](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | +| [Install the Merchant feature](/docs/pbc/all/merchant-management/{{page.version}}/base-shop/install-and-upgrade/install-the-merchant-feature.html) | diff --git a/docs/pbc/all/merchant-management/202403.0/marketplace/install-and-upgrade/install-features/install-the-marketplace-merchant-feature.md b/docs/pbc/all/merchant-management/202403.0/marketplace/install-and-upgrade/install-features/install-the-marketplace-merchant-feature.md new file mode 100644 index 00000000000..caa65aa0b0d --- /dev/null +++ b/docs/pbc/all/merchant-management/202403.0/marketplace/install-and-upgrade/install-features/install-the-marketplace-merchant-feature.md @@ -0,0 +1,12 @@ +--- +title: Install the Marketplace Merchant feature +last_updated: Jan 12, 2024 +description: This integration guide describes how to integrate the Merchants feature into a Spryker project. +template: feature-integration-guide-template +redirect_from: + - /docs/scos/dev/feature-integration-guides/{{page.version}}/merchant-feature-integration.html + - /docs/marketplace/dev/feature-integration-guides/{{page.version}}/feature-integration-guides.html + +--- + +{% include pbc/all/install-features/{{page.version}}/marketplace/install-the-marketplace-merchant-feature.md %} diff --git a/docs/pbc/all/warehouse-management-system/202403.0/unified-commerce/install-and-upgrade/install-the-warehouse-user-management-feature.md b/docs/pbc/all/warehouse-management-system/202403.0/unified-commerce/install-and-upgrade/install-the-warehouse-user-management-feature.md new file mode 100644 index 00000000000..b454f429692 --- /dev/null +++ b/docs/pbc/all/warehouse-management-system/202403.0/unified-commerce/install-and-upgrade/install-the-warehouse-user-management-feature.md @@ -0,0 +1,11 @@ +--- +title: Install the Warehouse User Management feature +description: Install the Warehouse User Management feature in your project +template: feature-integration-guide-template +last_updated: Jan 10, 2024 +redirect_from: + - /docs/scos/dev/feature-integration-guides/{{page.version}}/install-the-warehouse-user-management-feature.html + - /docs/pbc/all/warehouse-management-system/{{page.version}}/unified-commerce/fulfillment-app/install-and-upgrade/install-features/install-the-warehouse-user-management-feature.html +--- + +{% include pbc/all/install-features/{{page.version}}/unified-commerce/install-the-warehouse-user-management-feature.md %} diff --git a/docs/scos/dev/feature-walkthroughs/202204.0/merchant-b2b-contracts-feature-walkthrough.md b/docs/scos/dev/feature-walkthroughs/202204.0/merchant-b2b-contracts-feature-walkthrough.md index c8971daf68d..80201845b35 100644 --- a/docs/scos/dev/feature-walkthroughs/202204.0/merchant-b2b-contracts-feature-walkthrough.md +++ b/docs/scos/dev/feature-walkthroughs/202204.0/merchant-b2b-contracts-feature-walkthrough.md @@ -29,4 +29,4 @@ The following schema shows relations within the merchant domain: |INSTALLATION GUIDES | |---------| | [Merchant B2B Contracts feature integration](/docs/scos/dev/feature-integration-guides/{{page.version}}/merchant-b2b-contracts-feature-integration.html) | -| [Merchant feature integration](/docs/scos/dev/feature-integration-guides/{{page.version}}/merchant-feature-integration.html) | +| [Install the Merchant feature](/docs/scos/dev/feature-integration-guides/{{page.version}}/merchant-feature-integration.html) | diff --git a/docs/scos/dev/feature-walkthroughs/202204.0/merchant-product-restrictions-feature-walkthrough/merchant-product-restrictions-feature-walkthrough.md b/docs/scos/dev/feature-walkthroughs/202204.0/merchant-product-restrictions-feature-walkthrough/merchant-product-restrictions-feature-walkthrough.md index a687581f2bb..941a0606d53 100644 --- a/docs/scos/dev/feature-walkthroughs/202204.0/merchant-product-restrictions-feature-walkthrough/merchant-product-restrictions-feature-walkthrough.md +++ b/docs/scos/dev/feature-walkthroughs/202204.0/merchant-product-restrictions-feature-walkthrough/merchant-product-restrictions-feature-walkthrough.md @@ -27,4 +27,4 @@ The following schema illustrates product restrictions relations within the Merch | INSTALLATION GUIDES | |---------| | [Merchant B2B Contracts feature integration](/docs/scos/dev/feature-integration-guides/{{page.version}}/merchant-b2b-contracts-feature-integration.html) | -| [Merchant feature integration](/docs/scos/dev/feature-integration-guides/{{page.version}}/merchant-feature-integration.html) | +| [Install the Merchant feature](/docs/scos/dev/feature-integration-guides/{{page.version}}/merchant-feature-integration.html) | diff --git a/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-api-key-authorization.md b/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-api-key-authorization.md index 37c355b40a2..8d1c7ffa00a 100644 --- a/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-api-key-authorization.md +++ b/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-api-key-authorization.md @@ -19,7 +19,7 @@ Install the required features: | NAME | VERSION | INSTALLATION GUIDE | |------------------------------| ----------------- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Spryker Core | {{site.version}} | [Install the Spryker Core feature](/docs/pbc/all/miscellaneous/{{site.version}}/install-and-upgrade/install-features/install-the-spryker-core-feature.html) | -| Glue Backend API Application | {{page.version}} | [Glue Storefront and Backend API applications integration](/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-storefront-and-backend-glue-api-applications.html) | +| Glue Backend API Application | {{page.version}} | [Integrate Storefront and Backend Glue API applications](/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-storefront-and-backend-glue-api-applications.html) | ### 1) Install the required modules using Composer diff --git a/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-the-authentication.md b/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-the-authentication.md index c075433783f..caf9ea42198 100644 --- a/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-the-authentication.md +++ b/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-the-authentication.md @@ -1,38 +1,33 @@ --- title: "Decoupled Glue infrastructure: Integrate the authentication" description: Create an authentication token for the Storefront and Backend API applications in a Spryker project. -last_updated: September 30, 2022 +last_updated: Jan 10, 2024 template: feature-integration-guide-template redirect_from: - /docs/scos/dev/feature-integration-guides/202204.0/glue-api/decoupled-glue-infrastructure/glue-api-authentication-integration.html - /docs/scos/dev/feature-integration-guides/202212.0/glue-api/decoupled-glue-infrastructure/glue-api-authentication-integration.html --- -This document describes how to create an authentication token for the Storefront and Backend API applications in a Spryker project. +This document describes how to create an authentication token for the Storefront and Backend API applications. -## Install feature core - -Follow the steps below to install the Authentication feature API. - -### Prerequisites +## Prerequisites Install the required features: -| NAME | VERSION | INSTALLATION GUIDE | -| -------------- | ----------------- | ----------------- | -| Glue Backend API Application | {{page.version}} | [Glue Storefront and Backend API applications integration](/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-storefront-and-backend-glue-api-applications.html) | -| Glue Storefront API Application | {{page.version}} | [Glue Storefront and Backend API applications integration](/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-storefront-and-backend-glue-api-applications.html) | +| NAME | VERSION | INSTALLATION GUIDE | +|---------------------------------|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Storefront and Backend Glue API applications | {{page.version}} | [Integrate Storefront and Backend Glue API applications](/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-storefront-and-backend-glue-api-applications.html) | -### 1) Install the required modules using Composer +## 1) Install the required modules -Install the required modules: +Install the required modules using Composer: ```bash composer require spryker/oauth-api:"^1.0.0" \ spryker/oauth-backend-api:"^1.0.0" \ spryker/authentication-oauth:"^1.0.0" \ spryker/oauth-customer-connector:"^1.8.0" \ -spryker/oauth-user-connector:"^1.0.0" \ +spryker/oauth-user-connector:"^1.3.0" \ --update-with-dependencies ``` @@ -40,20 +35,20 @@ spryker/oauth-user-connector:"^1.0.0" \ Make sure that the following modules have been installed: -| MODULE | EXPECTED DIRECTORY | -| --- | --- | -| Authentication | vendor/spryker/authentication | +| MODULE | EXPECTED DIRECTORY | +|-------------------------|-----------------------------------------| +| Authentication | vendor/spryker/authentication | | AuthenticationExtension | vendor/spryker/authentication-extension | -| AuthenticationOauth | vendor/spryker/authentication-oauth | -| Oauth | vendor/spryker/oauth | -| OauthApi | vendor/spryker/oauth-api | -| OauthExtension | vendor/spryker/oauth-extension | -| OauthCustomerConnector | vendor/spryker/oauth-customer-connector | -| OauthUserConnector | vendor/spryker/oauth-user-connector | +| AuthenticationOauth | vendor/spryker/authentication-oauth | +| Oauth | vendor/spryker/oauth | +| OauthApi | vendor/spryker/oauth-api | +| OauthExtension | vendor/spryker/oauth-extension | +| OauthCustomerConnector | vendor/spryker/oauth-customer-connector | +| OauthUserConnector | vendor/spryker/oauth-user-connector | {% endinfo_block %} -### 2) Set up database schema and transfer objects +## 2) Set up database schema and transfer objects Apply database changes and generate entity and transfer changes: @@ -65,69 +60,75 @@ vendor/bin/console transfer:generate {% info_block warningBox "Verification" %} -Ensure that the following changes have occurred in the database: +Make sure the following changes have occurred in the database: -| DATABASE ENTITY | TYPE | EVENT | -| --- | --- | --- | +| DATABASE ENTITY | TYPE | EVENT | +|---------------------------|-------|---------| | spy\_oauth\_access\_token | table | created | -| spy\_oauth\_client | table | created | -| spy\_oauth\_scope | table | created | - -Ensure that the following changes have occurred in transfer objects: - -| TRANSFER | TYPE | EVENT | PATH | -| --- | --- | --- | --- | -| ApiTokenAttributes | class | created | src/Generated/Shared/Transfer/ApiTokenAttributesTransfer.php | -| ApiTokenResponseAttributes | class | created | src/Generated/Shared/Transfer/ApiTokenResponseAttributesTransfer.php | -| GlueAuthenticationRequest | class | created | src/Generated/Shared/Transfer/GlueAuthenticationRequestTransfer.php | -| GlueAuthenticationRequestContext | class | created | src/Generated/Shared/Transfer/GlueAuthenticationRequestContextTransfer.php | -| GlueAuthenticationResponse | class | created | src/Generated/Shared/Transfer/GlueAuthenticationResponseTransfer.php | -| GlueRequestCustomer | class | created | src/Generated/Shared/Transfer/GlueRequestCustomerTransfer.php | -| GlueRequestUser | class | created | src/Generated/Shared/Transfer/GlueRequestUserTransfer.php | -| OauthAccessTokenData | class | created | src/Generated/Shared/Transfer/OauthAccessTokenDataTransfer.php | -| OauthAccessTokenValidationRequest | class | created | src/Generated/Shared/Transfer/OauthAccessTokenValidationRequestTransfer.php | +| spy\_oauth\_client | table | created | +| spy\_oauth\_scope | table | created | + +Make sure the following changes have occurred in transfer objects: + +| TRANSFER | TYPE | EVENT | PATH | +|------------------------------------|-------|---------|------------------------------------------------------------------------------| +| ApiTokenAttributes | class | created | src/Generated/Shared/Transfer/ApiTokenAttributesTransfer.php | +| ApiTokenResponseAttributes | class | created | src/Generated/Shared/Transfer/ApiTokenResponseAttributesTransfer.php | +| GlueAuthenticationRequest | class | created | src/Generated/Shared/Transfer/GlueAuthenticationRequestTransfer.php | +| GlueAuthenticationRequestContext | class | created | src/Generated/Shared/Transfer/GlueAuthenticationRequestContextTransfer.php | +| GlueAuthenticationResponse | class | created | src/Generated/Shared/Transfer/GlueAuthenticationResponseTransfer.php | +| GlueRequestCustomer | class | created | src/Generated/Shared/Transfer/GlueRequestCustomerTransfer.php | +| GlueRequestUser | class | created | src/Generated/Shared/Transfer/GlueRequestUserTransfer.php | +| OauthAccessTokenData | class | created | src/Generated/Shared/Transfer/OauthAccessTokenDataTransfer.php | +| OauthAccessTokenValidationRequest | class | created | src/Generated/Shared/Transfer/OauthAccessTokenValidationRequestTransfer.php | | OauthAccessTokenValidationResponse | class | created | src/Generated/Shared/Transfer/OauthAccessTokenValidationResponseTransfer.php | -| OauthError | class | created | src/Generated/Shared/Transfer/OauthErrorTransfer.php | -| OauthRequest | class | created | src/Generated/Shared/Transfer/OauthRequestTransfer.php | -| OauthResponse | class | created | src/Generated/Shared/Transfer/OauthResponseTransfer.php | +| OauthError | class | created | src/Generated/Shared/Transfer/OauthErrorTransfer.php | +| OauthRequest | class | created | src/Generated/Shared/Transfer/OauthRequestTransfer.php | +| OauthScopeRequest | class | created | src/Generated/Shared/Transfer/OauthScopeRequestTransfer.php | +| OauthResponse | class | created | src/Generated/Shared/Transfer/OauthResponseTransfer.php | +| AuthorizationRequest | class | created | src/Generated/Shared/Transfer/AuthorizationRequestTransfer.php | +| AuthorizationEntity | class | created | src/Generated/Shared/Transfer/AuthorizationEntityTransfer.php | +| RouteAuthorizationConfig | class | created | src/Generated/Shared/Transfer/RouteAuthorizationConfigTransfer.php | {% endinfo_block %} -### 3) Set up behavior +## 3) Set up behavior 1. Activate the following plugins: -| PLUGIN | SPECIFICATION | NAMESPACE | -| --- | --- | --- | +| PLUGIN | SPECIFICATION | NAMESPACE | +|----------------------------|--------------------------------------------|-------------------------------------------------------| | OauthClientInstallerPlugin | Populates database with Oauth client data. | Spryker\\Zed\\Oauth\\Communication\\Plugin\\Installer | **Storefront API plugins:** -| PLUGIN | SPECIFICATION | NAMESPACE | -| --- | --- | --- | -| AccessTokenValidatorPlugin | Validates access token passed via authorisation header. | Spryker\\Glue\\OauthApi\\Plugin | -| CustomerRequestBuilderPlugin | Sets `GlueRequestTransfer.requestCustomer` if the customer credentials are valid. | Spryker\\Glue\\OauthApi\\Plugin | -| OauthAuthenticationServerPlugin | Makes request to process access token and builds `GlueAuthenticationResponseTransfer.oauthResponse`. | Spryker\\Client\\AuthenticationOauth\\Plugin | -| OauthCustomerScopeInstallerPlugin | Installs Oauth customer scope data. | Spryker\\Zed\\OauthCustomerConnector\\Communication\\Plugin\\Installer | -| OauthTokenResource | Registers the `token` resource. | Spryker\\Glue\\OauthApi\\Plugin\\GlueApplication | -| CustomerOauthUserProviderPlugin | Gets the customer based on authorisation client. | Spryker\\Zed\\OauthCustomerConnector\\Communication\\Plugin | -| CustomerOauthScopeProviderPlugin | Gets a list of customer scopes. | Spryker\\Zed\\OauthCustomerConnector\\Communication\\Plugin | -| CustomerPasswordOauthRequestGrantTypeConfigurationProviderPlugin | Builds `OauthGrantTypeConfigurationTransfer` from configuration of Password GrantType data. | Spryker\\Zed\\Oauth\\Communication\\Plugin\\Oauth | +| PLUGIN | SPECIFICATION | NAMESPACE | +|------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------| +| AccessTokenValidatorPlugin | Validates the access token passed via the authorization header. | Spryker\\Glue\\OauthApi\\Plugin | +| CustomerRequestBuilderPlugin | Sets `GlueRequestTransfer.requestCustomer` if the customer credentials are valid. | Spryker\\Glue\\OauthApi\\Plugin | +| OauthAuthenticationServerPlugin | Makes a request to process an access token and builds `GlueAuthenticationResponseTransfer.oauthResponse`. | Spryker\\Client\\AuthenticationOauth\\Plugin | +| OauthCustomerScopeInstallerPlugin | Installs the Oauth customer scope data. | Spryker\\Zed\\OauthCustomerConnector\\Communication\\Plugin\\Installer | +| OauthTokenResource | Registers the `token` resource. | Spryker\\Glue\\OauthApi\\Plugin\\GlueApplication | +| CustomerOauthUserProviderPlugin | Gets the customer based on the authorization client. | Spryker\\Zed\\OauthCustomerConnector\\Communication\\Plugin | +| CustomerOauthScopeProviderPlugin | Gets a list of customer scopes. | Spryker\\Zed\\OauthCustomerConnector\\Communication\\Plugin | +| CustomerPasswordOauthRequestGrantTypeConfigurationProviderPlugin | Builds `OauthGrantTypeConfigurationTransfer` the from configuration of Password GrantType data. | Spryker\\Zed\\Oauth\\Communication\\Plugin\\Oauth | **Backend API plugins:** -| PLUGIN | SPECIFICATION | NAMESPACE | -| --- | --- |--------------------------------------------------------------------| -| BackendApiAccessTokenValidatorPlugin | Validates access token passed via authorisation header. | Spryker\\Glue\\OauthBackendApi\\Plugin\\GlueApplication | -| CustomerRequestBuilderPlugin | Sets `GlueRequestTransfer.requestCustomer` if the customer credentials are valid. | Spryker\\Glue\\OauthBackendApi\\Plugin | -| OauthAuthenticationServerPlugin | Makes request to process access token and builds `GlueAuthenticationResponseTransfer.oauthResponse`. | Spryker\\Zed\\AuthenticationOauth\\Communication\\Plugin | -| OauthBackendTokenResource | Registers the `token` resource. | Spryker\\Glue\\OauthBackendApi\\Plugin\\GlueApplication | -| OauthUserScopeInstallerPlugin | Installs Oauth user scope data. | Spryker\\Zed\\OauthUserConnector\\Communication\\Plugin\\Installer | -| UserOauthScopeProviderPlugin | Gets a list of customer scopes. | Spryker\\Zed\\OauthUserConnector\\Communication\\Plugin\\Oauth | -| UserOauthUserProviderPlugin | Gets the user based on authorisation client. | Spryker\\Zed\\OauthUserConnector\\Communication\\Plugin\\Oauth | -| UserPasswordOauthRequestGrantTypeConfigurationProviderPlugin | Builds `OauthGrantTypeConfigurationTransfer` from configuration of Password GrantType data. | Spryker\\Zed\\Oauth\\Communication\\Plugin\\Oauth | -| UserRequestValidatorPlugin | Validates if `GlueRequestTransfer.requestUser` is set in case if request has Authorisation header. | Spryker\\Glue\\OauthBackendApi\\Plugin\\GlueApplication | - +| PLUGIN | SPECIFICATION | NAMESPACE | +|---------------------------------------------------------------|------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------| +| BackendApiAccessTokenValidatorPlugin | Validates the access token passed via the authorization header. | Spryker\\Glue\\OauthBackendApi\\Plugin\\GlueApplication | +| CustomerRequestBuilderPlugin | Sets `GlueRequestTransfer.requestCustomer` if the customer credentials are valid. | Spryker\\Glue\\OauthBackendApi\\Plugin | +| OauthAuthenticationServerPlugin | Makes a request to process the access token and builds `GlueAuthenticationResponseTransfer.oauthResponse`. | Spryker\\Zed\\AuthenticationOauth\\Communication\\Plugin | +| OauthBackendTokenResource | Registers the `token` resource. | Spryker\\Glue\\OauthBackendApi\\Plugin\\GlueApplication | +| OauthUserScopeInstallerPlugin | Installs the Oauth user scope data. | Spryker\\Zed\\OauthUserConnector\\Communication\\Plugin\\Installer | +| UserOauthScopeProviderPlugin | Gets a list of customer scopes. | Spryker\\Zed\\OauthUserConnector\\Communication\\Plugin\\Oauth | +| UserOauthUserProviderPlugin | Gets the user based on the authorization client. | Spryker\\Zed\\OauthUserConnector\\Communication\\Plugin\\Oauth | +| UserPasswordOauthRequestGrantTypeConfigurationProviderPlugin | Builds `OauthGrantTypeConfigurationTransfer` from the configuration of Password GrantType data. | Spryker\\Zed\\Oauth\\Communication\\Plugin\\Oauth | +| UserRequestValidatorPlugin | Validates if `GlueRequestTransfer.requestUser` is set if the request has the Authorisation header. | Spryker\\Glue\\OauthBackendApi\\Plugin\\GlueApplication | +| BackofficeUserOauthScopeAuthorizationCheckerPlugin | Executes the authorization check based on the Back Office user OAuth scope. | Spryker\Zed\OauthUserConnector\Communication\Plugin\OauthUserConnector | +| OauthUserScopeProtectedRouteAuthorizationConfigProviderPlugin | Provides the configuration of Oauth user authorization strategy. | Spryker\Glue\OauthUserConnector\Plugin\GlueBackendApiApplicationAuthorizationConnector | +| OauthUserScopeAuthorizationStrategyPlugin | Processes the authorization requests of Oauth users. | Spryker\Zed\OauthUserConnector\Communication\Plugin\Authorization | **src/Pyz/Client/Authentication/AuthenticationDependencyProvider.php** @@ -153,7 +154,7 @@ class AuthenticationDependencyProvider extends SprykerAuthenticationDependencyPr } ``` -
+
src/Pyz/Glue/GlueBackendApiApplication/GlueBackendApiApplicationDependencyProvider.****php ```php @@ -203,7 +204,7 @@ class GlueBackendApiApplicationDependencyProvider extends SprykerGlueBackendApiA ```
-
+
src/Pyz/Glue/GlueStorefrontApiApplication/GlueStorefrontApiApplicationDependencyProvider.php ```php @@ -303,7 +304,7 @@ class AuthenticationDependencyProvider extends SprykerAuthenticationDependencyPr } ``` -
+
src/Pyz/Zed/Oauth/OauthDependencyProvider.php ```php @@ -366,6 +367,87 @@ class OauthDependencyProvider extends SprykerOauthDependencyProvider ```
+**src/Pyz/Zed/OauthUserConnector/OauthUserConnectorDependencyProvider.php** + +```php + + */ + protected function getUserTypeOauthScopeAuthorizationCheckerPlugins(): array + { + return [ + new BackofficeUserOauthScopeAuthorizationCheckerPlugin(), + ]; + } +} +``` + +{% info_block warningBox "Prerequisites required" %} + +Apply the following changes only if [Decoupled Glue infrastructure: Integrate the API Key authorization](/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-api-key-authorization.html) is integrated. + +{% endinfo_block %} + +**src/Pyz/Glue/GlueBackendApiApplicationAuthorizationConnector/GlueBackendApiApplicationAuthorizationConnectorDependencyProvider.php** + +```php + + */ + protected function getProtectedRouteAuthorizationConfigProviderPlugins(): array + { + return [ + new OauthUserScopeProtectedRouteAuthorizationConfigProviderPlugin(), + ]; + } +} +``` + +**src/Pyz/Zed/Authorization/AuthorizationDependencyProvider.php** + +```php + + */ + protected function getAuthorizationStrategyPlugins(): array + { + return [ + new OauthUserScopeAuthorizationStrategyPlugin(), + ]; + } +} +``` + 2. Set up the Oauth client: ```bash @@ -374,43 +456,37 @@ vendor/bin/console setup:init-db {% info_block warningBox "Verification" %} -* Ensure that the Oauth client has been added to the `spy_oauth_client` table: - - 1. Run the SQL query: - ```sql - SELECT * FROM spy_oauth_client WHERE identifier = 'some-client-identifier'; - ``` - - 2. Check that the output contains one record. - +To verify that the Oauth client has been added to the `spy_oauth_client` table, run the SQL query: +```sql +SELECT * FROM spy_oauth_client WHERE identifier = 'some-client-identifier'; +``` +Make sure the output contains one record. -* Ensure that you can authenticate as a customer: - 1. Send the request: - ``` - POST /token/ HTTP/1.1 - Host: glue-storefront.mysprykershop.com - Content-Type: application/x-www-form-urlencoded - Accept: application/json - Content-Length: 66 - grant_type=password&username={customer_username}&password={customer_password} - ``` +* To verify that you can authenticate as a customer, send the request: +``` +POST /token/ HTTP/1.1 +Host: glue-storefront.mysprykershop.com +Content-Type: application/x-www-form-urlencoded +Accept: application/json +Content-Length: 66 - 2. Check that the output contains the 201 response with a valid token. +grant_type=password&username={customer_username}&password={customer_password} +``` +Make sure the output contains the 201 response with a valid token. -* Ensure that you can authenticate as a user: - 1. Send the request: - ``` - POST /token/ HTTP/1.1 - Host: glue-backend.mysprykershop.com - Content-Type: application/x-www-form-urlencoded - Accept: application/json - Content-Length: 66 +* To verify that you can authenticate as a user, send the request: +``` +POST /token/ HTTP/1.1 +Host: glue-backend.mysprykershop.com +Content-Type: application/x-www-form-urlencoded +Accept: application/json +Content-Length: 66 - grant_type=password&username={user_username}&password={user_password} - ``` +grant_type=password&username={user_username}&password={user_password} +``` +Make sure the output contains the 201 response with a valid token and the user can assess protected resources. - 2. Check that the output contains the 201 response with a valid token. {% endinfo_block %} diff --git a/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-the-glue-json-api-convention.md b/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-the-glue-json-api-convention.md index a47dc0e1fd4..0cfae4e2668 100644 --- a/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-the-glue-json-api-convention.md +++ b/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-the-glue-json-api-convention.md @@ -21,7 +21,7 @@ Install the required features: | NAME | VERSION | INSTALLATION GUIDE | | -------------- | ----------------- | ----------------- | -| Glue Storefront and Backend API Applications | {{page.version}} | [Glue Storefront and Backend API applications integration](/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-storefront-and-backend-glue-api-applications.html) | +| Glue Storefront and Backend API Applications | {{page.version}} | [Integrate Storefront and Backend Glue API applications](/docs/scos/dev/migration-concepts/migrate-to-decoupled-glue-infrastructure/decoupled-glue-infrastructure-integrate-storefront-and-backend-glue-api-applications.html) | ### 1) Install the required modules using Composer