$lineItem->
setRemovable($removeable);
$lineItem->
setStackable($stackable);
$lineItem->
setPayload($payload);
$lineItem->
setPriceDefinition( new AbsolutePriceDefinition( (float) $priceDefinition['price'
],
new LineItemOfTypeRule(Rule::OPERATOR_NEQ,
$type) ) );
$this->recalculationService->
addCustomLineItem($orderId,
$lineItem,
$context);
return new Response(null, Response::HTTP_NO_CONTENT
);
} #[Route(path: '/api/_action/order/{orderId}/lineItem', name: 'api.action.order.add-line-item', methods: ['POST'])]
public function addCustomLineItemToOrder(string
$orderId, Request
$request, Context
$context): Response
{ $identifier =
(string) $request->request->
get('identifier'
);
$type =
$request->request->
get('type', LineItem::CUSTOM_LINE_ITEM_TYPE
);
$quantity =
$request->request->
getInt('quantity', 1
);