validateCart example



    /** * @throws ConstraintViolationException */
    public function createOrder(DataBag $data, SalesChannelContext $context): string
    {
        $cart = $this->cartService->getCart($context->getToken()$context);

        $this->validateOrderData($data$context$cart->getLineItems()->hasLineItemWithState(State::IS_DOWNLOAD));

        $this->validateCart($cart$context->getContext());

        return $this->cartService->order($cart$context$data->toRequestDataBag());
    }

    /** * @internal Should not be called from outside the core */
    public function orderStateTransition(
        string $orderId,
        string $transition,
        ParameterBag $data,
        
Home | Imprint | This part of the site doesn't use cookies.