We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8.2
6.5.8.8
The original cart should not be changed in cart processors
Deliveries in the original cart are changed in DeliveryProcessor
For example convert an existing order to a cart and run the processors:
$cart = $this->orderConverter->convertToCart($existingOrder, $context); $behavior = new CartBehavior($salesChannelContext->getPermissions()); $cart = $this->processor->process($cart, $salesChannelContext, $behavior);
The deliveries from the original cart should be cloned and not changed for the calculation of the new cart:
` $deliveries = $original->getDeliveries(); $firstDelivery = $deliveries->first(); if ($firstDelivery === null) { return; }
// Stored original edit shipping cost $manualShippingCosts = $toCalculate->getExtension(self::MANUAL_SHIPPING_COSTS) ?? $firstDelivery->getShippingCosts(); $toCalculate->addExtension(self::MANUAL_SHIPPING_COSTS, $manualShippingCosts); if ($manualShippingCosts instanceof CalculatedPrice) { $firstDelivery->setShippingCosts($manualShippingCosts); } $this->deliveryCalculator->calculate($data, $toCalculate, $deliveries, $context); $toCalculate->setDeliveries($deliveries);
`
The text was updated successfully, but these errors were encountered:
We found the following existing issues which may help or are related to your topic:
Sorry, something went wrong.
No branches or pull requests
PHP Version
8.2
Shopware Version
6.5.8.8
Expected behaviour
The original cart should not be changed in cart processors
Actual behaviour
Deliveries in the original cart are changed in DeliveryProcessor
How to reproduce
For example convert an existing order to a cart and run the processors:
$cart = $this->orderConverter->convertToCart($existingOrder, $context); $behavior = new CartBehavior($salesChannelContext->getPermissions()); $cart = $this->processor->process($cart, $salesChannelContext, $behavior);
The deliveries from the original cart should be cloned and not changed for the calculation of the new cart:
`
$deliveries = $original->getDeliveries();
$firstDelivery = $deliveries->first();
if ($firstDelivery === null) {
return;
}
`
The text was updated successfully, but these errors were encountered: