Developer forum

Forum » Ecommerce - Standard features » Updating OrderLine fields in cart

Updating OrderLine fields in cart

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Guys,

I have a case where I need to allow the customer to edit the value in an OrderLineField. Somethign similar with the way I update the orderline for quantity changes.

I need to be able to make this update using AJAX. Is this possible using standard code or I need to create something cusotm for this purpose?

Thanks,

Adrian


Replies

 
Mario Santos
Reply

Hi Adrian,

From my experience with Orderline custom fields it's just another field that you sent in the form (it can be through AJAX). There is a loop with the OrderlineFields on each orderline loop item.

Hope this helps,

BR, Mário

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Mario,

Thanks a lot for the response.

This is how I first thought about it. Only I have to indicate the Orderline that needs Updating. Similar with how the QuantityUpdate works.

I am not sure if there is any convention for dealing with this type of update. For Quantity you use Quantity{ORDERLINE ID}. Should I use OrderLineField{ORDERLINE ID}?

Not sure how it should work. A bit of official guidance would be very helpful in order to avoid a lot of trial and error.

Thanks,

Adrian

 
Mario Santos
Reply

Hi Adrian,

The input name should be: OrderLineFieldValue_{OrderlineID}_{OrderLineFieldSystemName}.

If you want to list all fields there is a loop named Order.OrderLineFields inside each iteration of OrderLines loop.

BR, Mário

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thank you Mario,

I will try that.

Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Mario,

it looks like it only works for quantity update or entire cart.

Any other ideas?

Thanks

Adrian

 
Mario Santos
Reply

Hi Adrian,

Nope... I've being updating the entire cart. Maybe you will need to reach out to Nicolai.

BR, Mário

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thanks Mario.

@Nicolai: any suggestions? 

Thanks,

Adrian

 
Nicolai Pedersen
Reply

Really hard to tell without seeing the entire template etc. Just check that the data is posted to the right place - using developer tools maybe.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

What I would need, if the "official" way of handling this type of update. The documentation states somewhere that the orderline update is ment only for Quantity field. It might be outdated information though.

The bottom line question is how should an ajax call look like (or a form post) if I want to update the Orderline value of a field called PhoneNumber asuming the Orderline ID is 123 and the cart page ID is 100?

Thanks,

Adrian

 
Niels Foldager
Reply

Hi Adrian,

Did you find any solution on this issue?

Best regards,
Niels Foldager

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Niels,

I don't think we did.

I believe we had to rethink it.

Adrian

 

You must be logged in to post in the forum