Install the Cart + Product feature
Edit on GitHub
You are browsing a previous version of the document. The latest version is 202307.0.
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
Install the required features:
NAME | VERSION |
---|---|
Cart | 202204.0 |
Product | 202204.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.
Thank you!
For submitting the form