<?php declare(strict_types=1);
namespace Swag\BasicExample\Core\Checkout\Cart;
use Shopware\Core\Checkout\Cart\Cart;
use Shopware\Core\Checkout\Cart\CartBehavior;
use Shopware\Core\Checkout\Cart\CartProcessorInterface;
use Shopware\Core\Checkout\Cart\LineItem\CartDataCollection;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
class CustomCartProcessor implements CartProcessorInterface
public function process(CartDataCollection $data, Cart $original, Cart $toCalculate, SalesChannelContext $context, CartBehavior $behavior): void
$newData = $data->get('uniqueKey');
// Do stuff to the `$toCalculate` cart with your new data
foreach ($toCalculate->getLineItems()->getFlat() as $lineItem) {
$lineItem->setPayload($newData['stuff']);