$this->recalculationService->
addCustomLineItem($orderId,
$lineItem,
$context);
return new Response(null, Response::HTTP_NO_CONTENT
);
} #[Route(path: '/api/_action/order/{orderId}/promotion-item', name: 'api.action.order.add-promotion-item', methods: ['POST'])]
public function addPromotionItemToOrder(string
$orderId, Request
$request, Context
$context): Response
{ $code =
(string) $request->request->
get('code'
);
$cart =
$this->recalculationService->
addPromotionLineItem($orderId,
$code,
$context);
return new CartResponse($cart);
} #[Route(path: '/api/_action/order/{orderId}/toggleAutomaticPromotions', name: 'api.action.order.toggle-automatic-promotions', methods: ['POST'])]
public function toggleAutomaticPromotions(string
$orderId, Request
$request, Context
$context): Response
{ $skipAutomaticPromotions =
(bool) $request->request->
get('skipAutomaticPromotions', true
);
$cart =
$this->recalculationService->
toggleAutomaticPromotion($orderId,
$context,
$skipAutomaticPromotions);