Install the Cart + Marketplace Product Options feature
Edit on GitHubThis 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
To start feature integration, integrate the required features:
NAME | VERSION | INTEGRATION GUIDE |
---|---|---|
Marketplace Product Options | 202212.0 | Marketplace Product Options feature Integration |
Cart | 202212.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