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