Product Labels + Promotions and Discounts feature integration

Edit on GitHub
You are browsing a previous version of the document. The latest version is 202212.0.

Install Feature Core

Follow the steps below to install the feature core.


To start feature integration, overview, and install the necessary features:

Name Version
Promotions & Discounts 202009.0
Product Labels 202009.0
Spryker Core 202009.0

1) Set up Behavior

Set up the following behavirors:

Plugin Specification Prerequisites Namespace
ProductLabelCollectorPlugin Collects the cart items with product labels to which a discount should be applied. None Spryker\Zed\ProductLabelDiscountConnector\Communication\Plugin\Collector
ProductLabelDecisionRulePlugin Defines if a discount can be applied to a cart item with a product label. None Spryker\Zed\ProductLabelDiscountConnector\Communication\Plugin\DecisionRule



namespace Pyz\Zed\Discount;
use Spryker\Zed\Discount\DiscountDependencyProvider as SprykerDiscountDependencyProvider;
use Spryker\Zed\ProductLabelDiscountConnector\Communication\Plugin\DecisionRule\ProductLabelDecisionRulePlugin;
use Spryker\Zed\ProductLabelDiscountConnector\Communication\Plugin\Collector\ProductLabelCollectorPlugin;

class DiscountDependencyProvider extends SprykerDiscountDependencyProvider
     * @return \Spryker\Zed\Discount\Dependency\Plugin\DecisionRulePluginInterface[]
    protected function getDecisionRulePlugins()
        return array_merge(parent::getDecisionRulePlugins(), [
            new ProductLabelDecisionRulePlugin(),

     * @return \Spryker\Zed\Discount\Dependency\Plugin\CollectorPluginInterface[]
    protected function getCollectorPlugins()
        return array_merge(parent::getCollectorPlugins(), [
            new ProductLabelCollectorPlugin(),

Ensure that the plugins work correctly:

  1. Create a discount and define its condition as a query string with a product-label field.
  2. Add a product with the defined product label to cart.
  3. The discount should be applied to the cart.