Quick Add to Cart + Discontinued 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, overview and install the necessary features:

Name Version
Quick Add To Cart 201903.0
Discontinued Products 201903.0

1) Set up Behavior

Set up the Additional Functionality

Enable the following behaviors by registering the plugins:

Plugin Specification Prerequisites Namespace
ProductDiscontinuedItemValidatorPlugin Checks if the provided product SKU is discontinued, if yes - adds an error message. None Spryker\Client\ProductDiscontinuedStorage\Plugin\QuickOrder
src/Pyz/Client/QuickOrder/QuickOrderDependencyProvider.php
 <?php

namespace Pyz\Client\QuickOrder;

use Spryker\Client\ProductDiscontinuedStorage\Plugin\QuickOrder\ProductDiscontinuedItemValidatorPlugin;
use Spryker\Client\QuickOrder\QuickOrderDependencyProvider as SprykerQuickOrderDependencyProvider;

class QuickOrderDependencyProvider extends SprykerQuickOrderDependencyProvider
{
	/**
	* @return \Spryker\Client\QuickOrderExtension\Dependency\Plugin\ItemValidatorPluginInterface[]
	*/
	protected function getQuickOrderBuildItemValidatorPlugins(): array
	{
		return [
			new ProductDiscontinuedItemValidatorPlugin(),
		];
	}
    }

Verification
Make the following checks at `https://mysprykershop.com/quick-order`:
  • `ProductDiscontinuedItemValidatorPlugin`validates discontinued products. Provide the SKU of a discontinued product on the **Quick Add To Cart** page and verify that the error message is displayed and you are not allowed to work with this product.