Install the Persistent Cart + Comments

Edit on GitHub

This document describes how to integrate the Comments + Persistent Cart feature into a Spryker project.

Install feature core

Follow the steps below to install the Comments + Persistent Cart feature core.

Prerequisites

To start feature integration, integrate the required features

NAME VERSION INSTALLATION GUIDES
Comments 202204.0 Comments feature integration
Persistent Cart 202204.0

1) Set up behavior

Register the following plugins:

PLUGIN SPECIFICATION PREREQUISITES NAMESPACE
CommentThreadQuoteExpanderPlugin Expands quote transfer with CommentThread. None Spryker\Zed\Comment\Communication\Plugin\Quote

Pyz\Zed\Quote\QuoteDependencyProvider.php

<?php

namespace Pyz\Zed\Quote;

use Spryker\Zed\Comment\Communication\Plugin\Quote\CommentThreadQuoteExpanderPlugin;
use Spryker\Zed\Quote\QuoteDependencyProvider as SprykerQuoteDependencyProvider;

class QuoteDependencyProvider extends SprykerQuoteDependencyProvider
{
	/**
	 * @return \Spryker\Zed\QuoteExtension\Dependency\Plugin\QuoteExpanderPluginInterface[]
	 */
	protected function getQuoteExpanderPlugins(): array
	{
		return [
			new CommentThreadQuoteExpanderPlugin(),
		];
	}
}
Verification

Make sure that QuoteTransfer::commentThread contains information about comments when you retrieve a quote from the database.

Install feature frontend

Follow the steps below to install the Comments + Persistent Cart feature frontend.

Prerequisites

To start feature integration, integrate the required features

NAME VERSION INSTALLATION GUIDES
Comments 202204.0 Comments feature integration
Cart 202204.0 Install the Cart feature

1) Set up behavior

Register the following plugins:

PLUGIN SPECIFICATION PREREQUISITES NAMESPACE
CartCommentThreadAfterOperationStrategyPlugin Updates a session quote with the comment thread. None SprykerShop\Yves\CartPage\Plugin\CommentWidget

Pyz\Yves\CommentWidget\CommentWidgetDependencyProvider.php

<?php

namespace Pyz\Yves\CommentWidget;

use SprykerShop\Yves\CartPage\Plugin\CommentWidget\CartCommentThreadAfterOperationStrategyPlugin;
use SprykerShop\Yves\CommentWidget\CommentWidgetDependencyProvider as SprykerShopCommentDependencyProvider;

class CommentWidgetDependencyProvider extends SprykerShopCommentDependencyProvider
{
	/**
	 * @return \SprykerShop\Yves\CommentWidgetExtension\Dependency\Plugin\CommentThreadAfterOperationStrategyPluginInterface[]
	 */
	protected function getCommentThreadAfterOperationStrategyPlugins(): array
	{
		return [
			new CartCommentThreadAfterOperationStrategyPlugin(),
		];
	}
}
Verification

Make sure that add/update/remove actions update a session quote with the latest comment thread.