Marketplace Product Options + Cart feature integration
Edit on GitHub
You are browsing a previous version of the document. The latest version is 202307.0.
This document describes how to integrate the Marketplace Product Options + Cart feature into a Spryker project.
Install feature core
Follow the steps below to install the Marketplace Product Options + Cart feature core.
Prerequisites
Install the required features:
NAME | VERSION | INTEGRATION GUIDE |
---|---|---|
Marketplace Product Options | 202204.0 | Marketplace Product Options feature Integration |
Cart | 202204.0 | Cart feature integration |
1) Set up behavior
Enable the following behaviors by registering the plugins:
PLUGIN | DESCRIPTION | PREREQUISITES | NAMESPACE |
---|---|---|---|
MerchantProductOptionCartPreCheckPlugin | Checks the approval status for the merchant product options. | None | Spryker\Zed\MerchantProductOption\Communication\Plugin\Cart |
src/Pyz/Zed/Cart/CartDependencyProvider.php
<?php
namespace Pyz\Zed\Cart;
use Spryker\Zed\MerchantProductOption\Communication\Plugin\Cart\MerchantProductOptionCartPreCheckPlugin;
use Spryker\Zed\Cart\CartDependencyProvider as SprykerCartDependencyProvider;
class CartDependencyProvider extends SprykerCartDependencyProvider
{
/**
* @param \Spryker\Zed\Kernel\Container $container
*
* @return array<\Spryker\Zed\CartExtension\Dependency\Plugin\CartPreCheckPluginInterface>
*/
protected function getCartPreCheckPlugins(Container $container): array
{
return [
new MerchantProductOptionCartPreCheckPlugin(),
];
}
}
Verification
Make sure that validation works correctly with merchants product options in the cart and displays an error in case if any is not approved.
Thank you!
For submitting the form