Install the Marketplace Merchant Commission + Category Management feature
Edit on GitHubThis document describes how to install the Category Management + Marketplace Merchant Commission feature.
Prerequisites
Install the required features:
| NAME | VERSION | INSTALLATION GUIDE |
|---|---|---|
| Category Management | latest | Install the Category Management feature |
| Marketplace Merchant Commission | latest | Install the Marketplace Merchant Commission feature |
1) Install the required modules
composer require spryker/category-merchant-commission-connector:"^1.0.0" --update-with-dependencies
Verification
Make sure the following modules have been installed:
| MODULE | EXPECTED DIRECTORY |
|---|---|
| CategoryMerchantCommissionConnector | vendor/spryker/category-merchant-commission-connector |
2) Set up behavior
Set up the following behaviors:
| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE |
|---|---|---|---|
| CategoryMerchantCommissionItemCollectorRulePlugin | Collects the items whose categories match the provided clause. | Spryker\Zed\CategoryMerchantCommissionConnector\Communication\Plugin\MerchantCommission |
src/Pyz/Zed/MerchantCommission/MerchantCommissionDependencyProvider.php
<?php
namespace Pyz\Zed\MerchantCommission;
use Spryker\Zed\CategoryMerchantCommissionConnector\Communication\Plugin\MerchantCommission\CategoryMerchantCommissionItemCollectorRulePlugin;
use Spryker\Zed\MerchantCommission\MerchantCommissionDependencyProvider as SprykerMerchantCommissionDependencyProvider;
class MerchantCommissionDependencyProvider extends SprykerMerchantCommissionDependencyProvider
{
/**
* @return list<\Spryker\Zed\RuleEngineExtension\Communication\Dependency\Plugin\CollectorRulePluginInterface>
*/
protected function getRuleEngineCollectorRulePlugins(): array
{
return [
new CategoryMerchantCommissionItemCollectorRulePlugin(),
];
}
}
Verification
- Import a new merchant commission via data import or GUI import with an item condition defined as a query string with a
categoryfield. For example,category = 'cameras-and-camcorders'. - Add a merchant product assigned to the defined category to cart and place the order.
Make sure the following applies:
- The
commission-calculateOMS event has been triggered. - In the
spy_sales_merchant_commissiondatabase table, there’s a new record with your merchant commission applied to corresponding sales order item.
Thank you!
For submitting the form