Quick Add to Cart + Non-splittable Products feature integration
Edit on GitHub
You are browsing a previous version of the document. The latest version is 202212.0.
Install Feature Core
Prerequisites
To start feature integration, review and install the necessary features:
Name | Version |
---|---|
Quick Add To Cart | master |
Non-splittable Products | master |
1) Set up Behavior
Set up the Additional Functionality
Enable the following behaviors by registering the plugins:
Plugin | Specification | Prerequisites | Namespace |
---|---|---|---|
ProductQuantityItemValidatorPlugin |
Checks if the provided product quantity has quantity restrictions and provided quantity fits them, if no - adds an error message. | None | Spryker\Client\ProductQuantityStorage\Plugin\QuickOrder |
src/Pyz/Client/QuickOrder/QuickOrderDependencyProvider.php
<?php
namespace Pyz\Client\QuickOrder;
use Spryker\Client\ProductQuantityStorage\Plugin\QuickOrder\ProductQuantityItemValidatorPlugin;
use Spryker\Client\QuickOrder\QuickOrderDependencyProvider as SprykerQuickOrderDependencyProvider;
class QuickOrderDependencyProvider extends SprykerQuickOrderDependencyProvider
{
/**
* @return \Spryker\Client\QuickOrderExtension\Dependency\Plugin\ItemValidatorPluginInterface[]
*/
protected function getQuickOrderBuildItemValidatorPlugins(): array
{
return [
new ProductQuantityItemValidatorPlugin(),
];
}
}
Verification
Make the following checks at `https://mysprykershop.com/quick-order`:`ProductQuantityItemValidatorPlugin`takes care about quantities restrictions. Provide an SKU with quantity restrictions on the **Quick Add To Cart** page and verify if quantity gets automatically adjusted according to the quantity restrictions.
Thank you!
For submitting the form