Marketplace Cart feature integration

Edit on GitHub

This document describes how to integrate the Marketplace Cart feature into a Spryker project.

Install feature core

Follow the steps below to install the Marketplace Cart feature core.

Prerequisites

To start feature integration, integrate the required features:

NAME VERSION INTEGRATION GUIDE
Cart 202108.0 Cart feature integration
Order Threshold 202108.0 Order Threshold feature integration
Marketplace Order Management 202108.0 Marketplace Order Management feature integration

1) Install the required modules using Composer

Install the required modules:

composer require spryker-feature/marketplace-cart:"202108.0" --update-with-dependencies
Verification

Make sure that the following modules have been installed:

MODULE EXPECTED DIRECTORY
CartNoteMerchantSalesOrderGui vendor/spryker/cart-note-merchant-sales-order-gui

2) Set up configuration

Add the following configuration:

CONFIGURATION SPECIFICATION NAMESPACE
MerchantSalesOrderMerchantUserGuiConfig::getMerchantSalesOrderDetailExternalBlocksUrls() Introduces a list of urls for order details page configuration. src/Pyz/Zed/MerchantSalesOrderMerchantUserGui/MerchantSalesOrderMerchantUserGuiConfig.php
<?php

namespace Pyz\Zed\MerchantSalesOrderMerchantUserGui;

use Spryker\Zed\MerchantSalesOrderMerchantUserGui\MerchantSalesOrderMerchantUserGuiConfig as SprykerMerchantSalesOrderMerchantUserGuiConfig;

class MerchantSalesOrderMerchantUserGuiConfig extends SprykerMerchantSalesOrderMerchantUserGuiConfig
{
    /**
     * @return string[]
     */
    public function getMerchantSalesOrderDetailExternalBlocksUrls(): array
    {
        return [
            'cart_note' => '/cart-note-merchant-sales-order-gui/merchant-sales-order/list',
        ];
    }
}
Verification

Ensure that the cart notes are displayed on the order view page when looking at merchant orders in the Back Office.

Install feature front end

Follow the steps below to install the Marketplace Cart feature front end.

Prerequisites

To start feature integration, integrate the required features:

NAME VERSION
Order Threshold 202108.0
Cart 202108.0
Merchant Portal Core 202108.0
Marketplace Order Management 202108.0

1) Install the required modules using Composer

Install the required modules:

composer require spryker/cart-note-merchant-portal-gui:"^1.0.0" --update-with-dependencies
Verification

Make sure that the following modules have been installed:

MODULE EXPECTED DIRECTORY
CartNoteMerchantPortalGui spryker/cart-note-merchant-portal-gui

2) Set up behavior

Add the following configuration to the project:

PLUGIN SPECIFICATION PREREQUISITES NAMESPACE
CartNoteMerchantOrderItemTableExpanderPlugin Adds CartNote column to Sales tables in MerchantPortal Marketplace Sales Merchant Portal integrated Spryker\Zed\CartNoteMerchantPortalGui\Communication\Plugin

src/Pyz/Zed/SalesMerchantPortalGui/SalesMerchantPortalGuiDependencyProvider.php

<?php

namespace Pyz\Zed\SalesMerchantPortalGui;

use Spryker\Zed\CartNoteMerchantPortalGui\Communication\Plugin\SalesMerchantPortalGui\CartNoteMerchantOrderItemTableExpanderPlugin;
use Spryker\Zed\SalesMerchantPortalGui\SalesMerchantPortalGuiDependencyProvider as SprykerSalesMerchantPortalGuiDependencyProvider;

class SalesMerchantPortalGuiDependencyProvider extends SprykerSalesMerchantPortalGuiDependencyProvider
{
    /**
     * @return \Spryker\Zed\SalesMerchantPortalGuiExtension\Dependency\Plugin\MerchantOrderItemTableExpanderPluginInterface[]
     */
    protected function getMerchantOrderItemTableExpanderPlugins(): array
    {
        return [
            new CartNoteMerchantOrderItemTableExpanderPlugin(),
        ];
    }
}
Verification

Make sure that the CartNoteMerchantOrderItemTableExpanderPlugin plugin is set up by opening http://zed.mysprykershop.com/sales-merchant-portal-gui/orders. Click on any order and check that the Cart Note column is present.