Multiple Carts- Quick Order feature integration

Edit on GitHub

Install Feature Core

Prerequisites

To start feature integration, overview and install the necessary features:

Name Version
Multiple Carts 2018.11.0
Quick Add To Cart 2018.11.0
Spryker Core 2018.11.0

1) Set up Behavior

Register the following plugin:

Plugin Specification Prerequisites Namespace
QuickOrderQuoteNameExpanderPlugin Adds a default quick order name and add it to add item request. Spryker\Client\MultiCart\Plugin
src/Pyz/Client/PersistentCart/PersistentCartDependencyProvider.php
<?php

namespace Pyz\Client\PersistentCart;

use Spryker\Client\MultiCart\Plugin\QuickOrderQuoteNameExpanderPlugin;
use Spryker\Client\PersistentCart\PersistentCartDependencyProvider as SprykerPersistentCartDependencyProvider;

class PersistentCartDependencyProvider extends SprykerPersistentCartDependencyProvider
{
/**
* @return \Spryker\Client\PersistentCartExtension\Dependency\Plugin\PersistentCartChangeExpanderPluginInterface[]
*/
protected function getChangeRequestExtendPlugins(): array
{
return [
new QuickOrderQuoteNameExpanderPlugin(),
];
}
} 

Verification
If items have been added to the cart with param `createOrder`, a new customer cart must be created with the name "Quick order {date of creation}".

Install feature frontend

Prerequisites

Please overview and install the necessary features before beginning the integration step.

Name Version
Multiple Carts 2018.11.0
Quick Add To Cart 2018.11.0
Spryker Core 2018.11.0

1) Set up Widgets

Register the following global widget:

Widget Description Namespace
QuickOrderPageWidget Shows a cart list in the quick order page. SprykerShop\Yves\MultiCartWidget\Widget
src/Pyz/Yves/ShopApplication/ShopApplicationDependencyProvider.php
<?php

namespace Pyz\Yves\ShopApplication;

use SprykerShop\Yves\MultiCartWidget\Widget\QuickOrderPageWidget;
use SprykerShop\Yves\ShopApplication\ShopApplicationDependencyProvider as SprykerShopApplicationDependencyProvider;

class ShopApplicationDependencyProvider extends SprykerShopApplicationDependencyProvider
{
 /**
 * @return string[]
 */
 protected function getGlobalWidgets(): array
 {
 return [
 QuickOrderPageWidget::class,
 ];
 }
} 

Run the following command to enable Javascript and CSS changes:

Verification
Make sure that the following widgets have been registered:
ModuleTest
`QuickOrderPageWidget`Go to the quick order page. A shopping cart list should be added to the Add to cart form.