Multiple Carts- Quick Order 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
Multiple Carts 201903.0
Quick Add To Cart 201903.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 adds 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 parameter `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 201903.0
Quick Add To Cart 201903.0
Spryker Core 201903.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:

console frontend:yves:build
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.