Install the Quick Add to Cart + Packaging Units feature

Edit on GitHub

Install feature frontend

Prerequisites

Install the required features:

NAME VERSION
Quick Order 202410.0
Packaging Units 202410.0

1) Set up behavior

Set up the additional functionality

Enable the following behaviors by registering the plugins:

PLUGIN SPECIFICATION PREREQUISITES NAMESPACE
QuickOrderItemDefaultPackagingUnitExpanderPlugin Expands ItemTransfer with packaging unit data if available. None SprykerShop\Yves\ProductPackagingUnitWidget\Plugin\QuickOrder

src/Pyz/Yves/QuickOrderPage/QuickOrderPageDependencyProvider.php

<?php

namespace Pyz\Yves\QuickOrderPage;

use SprykerShop\Yves\ProductPackagingUnitWidget\Plugin\QuickOrder\QuickOrderItemDefaultPackagingUnitExpanderPlugin;
use SprykerShop\Yves\QuickOrderPage\QuickOrderPageDependencyProvider as SprykerQuickOrderPageDependencyProvider;

class QuickOrderPageDependencyProvider extends SprykerQuickOrderPageDependencyProvider
{
	/**
	* @return \SprykerShop\Yves\QuickOrderPageExtension\Dependency\Plugin\QuickOrderItemExpanderPluginInterface[]
	*/
	protected function getQuickOrderItemTransferExpanderPlugins(): array
	{
		return [
			new QuickOrderItemDefaultPackagingUnitExpanderPlugin(),
		];
	}
}
Verification

Make the following checks at https://mysprykershop.com/quick-order: QuickOrderItemDefaultPackagingUnitExpanderPlugin sets default configuration for a product with packaging units:

  • Select a product with packaging units on the Quick Add To Cart page and add it to the cart.
  • Check ItemTransfer in Cart if it has amount, amountSalesUnit, amountLeadProduct, and productPackagingUnit properties set.