Product + Order Management feature integration

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

Install Feature Core

Prerequisites

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

Feature Version
Product master
Order Management master
Spryker Core master

1) Install the required modules using Composer

Run the following command(s) to install the required modules:

composer require spryker/sales-product-connector:"^1.3.0" --update-with-dependencies
Verification

Make sure that the following modules have been installed:

Module Expected Directory
SalesProductConnector vendor/spryker/sales-product-connector
### 2) Set up Transfer Objects Run the following command to generate transfer changes: ```bash console transfer:generate ```
Verification

Make sure that the following changes have been applied in transfer objects:

Transfer Type Event Path
Order.idSalesOrder property Created src/Generated/Shared/Transfer/OrderTransfer
Item.fkSalesOrder property Created src/Generated/Shared/Transfer/ItemTransfer

3) Set up Behavior

Register the following plugins: | Plugin | Specification | Prerequisites | Namespace | | — | — | — | — | | ItemMetadataSearchOrderExpanderPlugin | Expands order items with metadata information. | None | Spryker\Zed\SalesProductConnector\Communication\Plugin\Sales |

\Pyz\Zed\Sales\SalesDependencyProvider

<?php

namespace Pyz\Zed\Sales;

use Spryker\Zed\Sales\SalesDependencyProvider as SprykerSalesDependencyProvider;
use Spryker\Zed\SalesProductConnector\Communication\Plugin\Sales\ItemMetadataSearchOrderExpanderPlugin;

class SalesDependencyProvider extends SprykerSalesDependencyProvider
{
    /**
     * @return \Spryker\Zed\SalesExtension\Dependency\Plugin\SearchOrderExpanderPluginInterface[]
     */
    protected function getSearchOrderExpanderPlugins(): array
    {
        return [
            new ItemMetadataSearchOrderExpanderPlugin(),
        ];
    }
}
Verification

Make sure that every order item from SalesFacade::searchOrders() results contains metadata information.