Support promotions / discounts in when requesting a quote
Currently, you cannot request a quote as long as there is an active promotion in your cart.
-
Florian Lang
commented
For our business process, it is very important that promotion codes can optionally be kept when a quote request is created.
In our case, promotions are not only used for short-term marketing campaigns, but also for customer-specific pricing logic and agreed discount structures. If these promotions are automatically removed during the quote request process, the calculated price no longer reflects the customer’s actual purchasing conditions.
Since manual discounts can still be added to a quote afterwards, we believe this decision should be configurable by the shop operator. This would allow each merchant to decide whether promotion codes should be removed or preserved, depending on their individual business model.
An optional setting would make the quote process much more flexible and would avoid unnecessary manual work, pricing inconsistencies, and confusion for both merchants and customers.
-
Julian Richter
commented
Another customer requested this feature. It should be optional to allow promotion codes when requesting an offer as a customer. As of now we only allow promotion codes to be added once a quote results in an order but not when requesting it.
I am aware of the desicion --> This is because promotions can change over time and can depend on different rules.
But maybe there could be some sort of option to enable to allow that anyways so the shop owner get to choose the behavior in the first place.
-
Possible fix from customer:
The change we did in shopware terms is to first decorate the Shopware\Commercial\B2B\QuoteManagement\Domain\CartToQuote\QuoteRequestRoute class in the plugin and changed the request functionAdded code for removing the discount items from the cart before the validate function is called. So that there will be no validation error when creating a Quote which has discount items in the cart.
$cart = $this->cartService->getCart($context->getToken(), $context); if ($cart->getLineItems()->filterType(LineItem::PROMOTION_LINE_ITEM_TYPE)->count() > 0) { $discountItems = $cart->getLineItems()->filterType(LineItem::PROMOTION_LINE_ITEM_TYPE)->getElements(); $discountItemIds = array_map(function (LineItem $item) { return $item->getId(); }, $discountItems); $this->cartService->removeItems($cart, $discountItemIds, $context); } $this->validateCart($cart, $context->getContext());