Marketplace Inventory Management + Packaging Units feature integration

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

This document describes how to integrate the Marketplace Inventory Management + Packaging Units feature into a Spryker project.

Install feature core

Follow the steps below to install the Marketplace Inventory Management + Packaging Units feature core.

Prerequisites

To start feature integration, integrate the required features:

NAME VERSION INTEGRATION GUIDE
Packaging Units 202108.0 Packaging Units feature integration
Marketplace Inventory Management 202108.0 Marketplace Inventory Management feature integration
Marketplace Order Management 202108.0 Marketplace Order Management feature integration

1) Set up behavior

Activate the following plugins:

PLUGIN SPECIFICATION PREREQUISITES NAMESPACE
ProductOfferPackagingUnitOmsReservationAggregationPlugin Aggregates reservations for product offers packaging unit. Spryker\Zed\ProductOfferPackagingUnit\Communication\Plugin\Oms

src/Pyz/Zed/Oms/OmsDependencyProvider.php

<?php

namespace Pyz\Zed\Oms;

use Spryker\Zed\Oms\OmsDependencyProvider as SprykerOmsDependencyProvider;
use Spryker\Zed\ProductOfferPackagingUnit\Communication\Plugin\Oms\ProductOfferPackagingUnitOmsReservationAggregationPlugin;

class OmsDependencyProvider extends SprykerOmsDependencyProvider
{
    /**
     * @return array<\Spryker\Zed\OmsExtension\Dependency\Plugin\OmsReservationAggregationPluginInterface>
     */
    protected function getOmsReservationAggregationPlugins(): array
    {
        return [
            new ProductOfferPackagingUnitOmsReservationAggregationPlugin(),
        ];
    }
}
Verification

Make sure that availability is calculated properly for the product offers that belong to the product with packaging units.

  • Add such a product offer to the cart.
  • Place an order.
  • Make sure that spy_oms_product_offer_reservation contains a new row, which has reserved the quantity equal to the amount of the bought packaging unit.