Product + Cart feature integration

Edit on GitHub
“Attention!”
The following feature integration guide expects the basic feature to be in place. The current feature integration guide only adds the **Product Image functionality**.

Install Feature Core

Prerequisites

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

Name Version
Cart 202001.0
Product 202001.0

1) Install the required modules using Composer

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

composer require spryker/product-image-cart-connector:"^1.1.0" --update-with-dependencies
“Verification”

Make sure that the following modules have been installed:

Module Expected Directory
ProductImageCartConnector vendor/spryker/product-image-cart-connector

2) Set up Transfer Objects

Run the following command to generate transfer objects:

console transfer:generate

3) Set up Behavior

Register the following plugins:

Plugin Specification Prerequisites Namespace
ProductImageCartPlugin Expands ItemsTransfers from CartChangeTransfer with ProductImages. None Spryker\Zed\ProductImageCartConnector\Communication\Plugin

src/Pyz/Zed/Cart/CartDependencyProvider.php

<?php
 
namespace Pyz\Zed\Cart;
 
use Spryker\Zed\Cart\CartDependencyProvider as SprykerCartDependencyProvider;
use Spryker\Zed\ProductImageCartConnector\Communication\Plugin\ProductImageCartPlugin;
use Spryker\Zed\Kernel\Container;
 
class CartDependencyProvider extends SprykerCartDependencyProvider
{
	/**
	* @param \Spryker\Zed\Kernel\Container $container
	*
	* @return \Spryker\Zed\Cart\Dependency\ItemExpanderPluginInterface[]
	*/
	protected function getExpanderPlugins(Container $container)
	{
		return [
			new ProductImageCartPlugin(),
		];
	}
}
“Verification”

Check cart product image expander plugins - make sure you can see images related to cart items in the cart page in Yves.