Cart- Non-splittable Products feature integration
Edit on GitHubInstall Feature Core
Prerequisites
To start feature integration, overview and install the necessary features:
Name | Version |
---|---|
Cart | 201903.0 |
Non-splittable Products | 201903.0 |
1) Set up Behavior
Adjust Concrete Product Quantity
Add the following plugins to your project:
Plugin | Specification | Prerequisites | Namespace |
---|---|---|---|
CartChangeTransferQuantityNormalizerPlugin |
The plugin is responsible for adjusting concrete products quantity and adding notification messages about that. | The ProductQuantity and ProductQuantityStorage modules should be installed. |
Spryker\Zed\ProductQuantity\Communication\Plugin\Cart |
src/Pyz/Zed/Cart/CartDependencyProvider.php
<?php
namespace Pyz\Zed\Cart;
use Spryker\Zed\Cart\CartDependencyProvider as SprykerCartDependencyProvider;
use Spryker\Zed\Kernel\Container;
use Spryker\Zed\ProductQuantity\Communication\Plugin\Cart\CartChangeTransferQuantityNormalizerPlugin;
class CartDependencyProvider extends SprykerCartDependencyProvider
{
/**
* @param \Spryker\Zed\Kernel\Container $container
*
* @return \Spryker\Zed\CartExtension\Dependency\Plugin\CartChangeTransferNormalizerPluginInterface[]
*/
protected function getCartBeforePreCheckNormalizerPlugins(Container $container): array
{
return [
new CartChangeTransferQuantityNormalizerPlugin(),
];
}
}
Verification
Once you are done with this step, add any Product with the quantity restrictions (Min Qty, Max Qty, Qty Interval
Thank you!
For submitting the form