-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Labels
Platform(Default)component/inventory-productsdomain/inventoryResponsible for managing products and everything product-relatedResponsible for managing products and everything product-relatedpriority/highItems that we should do soon.Items that we should do soon.
Description
Shopware Version
6.7.6.2
Affected area / extension
Platform(Default)
Actual behaviour
When adding a product to the cart, the regulation price is left empty in the price-definition and thus is also missing from the calculated price of a cart line-item.
Relevant code section (ProductCartProcessor::buildPriceDefinition):
shopware/src/Core/Content/Product/Cart/ProductCartProcessor.php
Lines 415 to 433 in 061e131
| private function buildPriceDefinition(CalculatedPrice $price, int $quantity): QuantityPriceDefinition | |
| { | |
| $definition = new QuantityPriceDefinition($price->getUnitPrice(), $price->getTaxRules(), $quantity); | |
| if ($price->getListPrice() !== null) { | |
| $definition->setListPrice($price->getListPrice()->getPrice()); | |
| } | |
| if ($price->getReferencePrice() !== null) { | |
| $definition->setReferencePriceDefinition( | |
| new ReferencePriceDefinition( | |
| $price->getReferencePrice()->getPurchaseUnit(), | |
| $price->getReferencePrice()->getReferenceUnit(), | |
| $price->getReferencePrice()->getUnitName() | |
| ) | |
| ); | |
| } | |
| return $definition; | |
| } |
Expected behaviour
The regulation-price is also added to the price object of a cart line-item, in order to show regulation-price difference in the shopping-cart.
Here's a patch, that fixes this:
productcartprocessor_add_regulation_prices.patch
How to reproduce
- Add a product with a configured regulation-price to the cart.
- Observe the regulation-price not being present in the cart.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Platform(Default)component/inventory-productsdomain/inventoryResponsible for managing products and everything product-relatedResponsible for managing products and everything product-relatedpriority/highItems that we should do soon.Items that we should do soon.