Alternative Products: Product Label Feature Integration

Install Feature Core

Prerequisites

Please review and install the necessary features before beginning the integration.

Name Version
Alternative Products 201903.0
Product Label 201903.0

1) Install the Required Modules Using Composer

Run the following command to install the required modules:

composer require spryker/product-alternative-product-label-connector:"^1.0.0" --update-with-dependencies

Make sure that the following modules have been installed:

Module Expected Directory
ProductAlternativeProductLabelConnector vendor/spryker/product-alternative-product-label-connector

2) Import Data

Add Infrastructural Data

Plugin Specification Prerequisites Namespace
ProductAlternativeProductLabelConnectorInstallerPlugin Installs the configured infrastructural alternative product labels. None Spryker\Zed\ProductAlternativeProductLabelConnector\Communication\Plugin\Installer

Add the following to your project:

Run the following console command to:

  • Execute registered installer plugins
  • Install the infrastructural data

console setup:init-db

Make sure that the configured infrastructural alternative product label has been added to the spy_product_label table in the database.

3) Set up Behavior

Setup Alternative Products Labels Workflow

Enable the following behavior types by registering the plugins:

Plugin Specification Prerequisites Namespace
PostProductAlternativeCreatePlugin After the product alternative is created, adds product alternatives availability label to the abstract product. None Spryker\Zed\ProductAlternativeProductLabelConnector\Communication\Plugin
PostProductAlternativeDeletePlugin After the product alternative is deleted, removes product alternatives availability label from the abstract product. None Spryker\Zed\ProductAlternativeProductLabelConnector\Communication\Plugin
ProductAlternativeLabelUpdaterPlugin Used to persist alternative product label relation changes into the database.

The plugin is called when the ProductLabelRelationUpdaterConsole command is executed.

None Spryker\Zed\ProductAlternativeProductLabelConnector\Communication\Plugin

Make sure, that:

  • When you add product alternatives, it adds the corresponding label to the product.
  • When you remove product alternatives, it removes the corresponding label from the product.

 

See also:

 

Last review date: March 28, 2019