Developer forum

Forum » Ecommerce - Standard features » Relate orderlines when adding to cart

Relate orderlines when adding to cart

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Guys,

I am trying to achieve something similar with PartsLists but without using  PartsLists.

More exactly, I am trying to connect 2 orderlines by using some hidden fields in the add to cart call. I am planning on using Multi AddToCart.

The option that I have so far is to use an Orderline field and store some unique identifier for both orderlines.

But I thought it worth asking if there is a more elegant solution.

Thanks,

Adrian


Replies

 
Nicolai Pedersen
Reply

Hi Adrian

Currently not (what I am aware of). Orderlines have parent orderline ids on their rows. That is used by discounts and BOM. I do not know what will happen if you use code to update that field with the relation information. It may work, but probably not...

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you. In this case I will use an OrderlineField to handle this connection.

It is safer.

Thank you,
Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Speaking of Orderline values.

I have some trouble getting the value of an orderline field.

I see 2 contradicting definitions here:http://doc.dynamicweb.com/template-tags/ecommerce/shopping-cart/email/orderlines/product-orderlinefields

Product.OrderLineFields

Order.OrderLineFields
They both seem to be related to the same Loop.
I know I have to loop through the OrderlineFields loop and then use 
@GetString("Ecom:Order:OrderLine.OrderLineField.Value.Clean")

But any combination of those does not render anything.

What is the correct approach to get the value of an OrderlineField?

Thank you,

Adrian

 
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Nevermind. I got it.

The correct loop is  GetLoop("Order.OrderLineFields")

And the value can be read with GetString("Ecom:Order:OrderLine.OrderLineField.Value.Clean")

Thanks,

Adrian

 

You must be logged in to post in the forum