Marketplace Product + Marketplace Product Offer feature integration

Edit on GitHub

This document describes how to integrate the Marketplace Product + Marketplace Product Offer feature into a Spryker project.

Install feature core

Follow the steps below to install the Marketplace Product + Marketplace Product Offer feature core.

Prerequisites

To start feature integration, integrate the required features:

NAME VERSION INTEGRATION GUIDE
Spryker Core 202204.0 Spryker Core feature integration
Marketplace Product 202204.0 Marketplace Product feature integration
Product Offer 202204.0 Marketplace Product Offer feature integration

Set up behavior

Enable the following behaviors by registering the plugins:

PLUGIN DESCRIPTION PREREQUISITES NAMESPACE
MerchantProductProductOfferReferenceStrategyPlugin Allows selecting a merchant product by default on PDP. Spryker\Client\MerchantProductStorage\Plugin\ProductOfferStorage
Note

The order is important. Plugin has to be registered after ProductOfferReferenceStrategyPlugin.

src/Pyz/Client/ProductOfferStorage/ProductOfferStorageDependencyProvider.php

<?php

namespace Pyz\Client\ProductOfferStorage;

use Spryker\Client\MerchantProductStorage\Plugin\ProductOfferStorage\MerchantProductProductOfferReferenceStrategyPlugin;
use Spryker\Client\ProductOfferStorage\ProductOfferStorageDependencyProvider as SprykerProductOfferStorageDependencyProvider;

class ProductOfferStorageDependencyProvider extends SprykerProductOfferStorageDependencyProvider
{
    /**
     * @return array<\Spryker\Client\ProductOfferStorageExtension\Dependency\Plugin\ProductOfferReferenceStrategyPluginInterface>
     */
    protected function getProductOfferReferenceStrategyPlugins(): array
    {
        return [
            new MerchantProductProductOfferReferenceStrategyPlugin(),
        ];
    }
}

Verification

Make sure you can switch between merchant products and product offers on the Product Details page.

Make sure that merchant products selected on the Product Details page by default.