Developer forum

Forum » Development » Convert quote to order

Convert quote to order

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a situation where I need to convert a quote to an order and checkout. Basically, I need to move from Quote to completed order withour an intermediary step.

For a very complicated reason, I am listing the quotes with Data list, so no Customer center module.

What would be the best approach to accomplish this task? API? Some CartCmd properties?

Thank you,

Adrian


Replies

 
Nicolai Pedersen
Reply

You want to make it a cart and then checkout - or you want it to make it an order directly?

You first have to make it a cart - and then convert to order:

Change to cart:

Dim quoteId As String = Context.Current.Request("AddQuoteId")
            If Not String.IsNullOrEmpty(quoteId) Then
                Dim quoteToAdd As Order = OrderManager.GetOrderForCurrentUser(quoteId)
                quoteToAdd.CartV2StepIndex = 0
                If quoteToAdd.OrderState.AllowOrder Then
                    Common.Context.SetCart(quoteToAdd)
                End If
            End If

And make it an order:

OrderService.UpdateCartToOrder

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you for the response.

Ideally, I would turn it directly into Quote.

But this approach would do it if I don't have to take the user through multiple steps.

Thank you very much.

Adrian

 

You must be logged in to post in the forum