Developer forum

Forum » Swift » Orderlinefields in checkout

Orderlinefields in checkout

Aki Ruuskanen
Aki Ruuskanen
Reply

HI,

What would be the best way to implement support for orderlinefields in Swift. 

I tried to just render them in the template "OrderLineItem.cshtml" with the OrderlineFIelds loop and the Ecom:Order:OrderLine.OrderLineField.InputTextField.Name tag as name and ID for the formfield.  But they are not presisted when continuing from that step. 

Regards / Aki

 


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply
This post has been marked as an answer

Hi Aki,

 

We've done that for a customer. I can provide you with the changes. Bare in mind that in our case we also updated the cart summary with some tooltip, the email and order details.

 

Attached are printscreens of all the files and all of changes needed for it to work. It could be cleaned up a bit, at least to point to a particular orderline custom field, but if you only have 1, should work just fine.

 

Sorry I can't copy-paste the code as easilly as the screendumps. Hope it helps.

 

Let me know if you need anything else.

Nuno Aguiar

Votes for this answer: 1
 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi Nuno.

Thanks very much for this. Of course the the "UpdateQuantity" function. Now I feel lazy. :) 

Thanks again!

Regards / Aki

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Aki,

 

Well, being explicitly named UpdateQuantity() makes it harder to deduce it. If it were called UpdateOrderline() instead would be more obvious.

But it's very easy to say this now. I probably would have called it UpdateQuantity() if I would have developed it as well :)

 

Glad you got it working.

 

Nuno Aguiar

 

You must be logged in to post in the forum