Developer forum

Forum » Templates » OrderLine fields how to?

OrderLine fields how to?

Dmitrij Jazel
Reply

Hi guys, I was wondering if anyone of you could have an example on how to use OrderLine fields?

I created OrderLine field, but I am not able to set it.

But am having trouble generating input field for it.


Replies

   
Dimitrij Jazel
Reply

Hi Nicolai,

Well no doubt it is great to have a description about the feature.

But it would be even better to have an actual working example of the feature (this counts other features of DW). Here is one:

@foreach (var orderline in GetLoop("OrderLines"))
{
    <td>    
        @{
            // http POST
            foreach (var f in orderline.GetLoop("Order.OrderLineFields"))
            {
                //input name result: OrderLineFieldValue_OL123_Systemname
                <text>@f.GetValue("Ecom:Order:OrderLine.OrderLineField.InputTextField")</text>
            }
        }
    </td>
}

 

Strange why this is not the case, cause when you implement new feature, you do use the code in the template to test it (most likely) why it was not included in the API documentation?

 

Some feedback on this.

Why would you ever have Product.OrderLineFields and Order.OrderLineFields loops.

IF Product.OrderLineFields is meant for edditing OrderField in the Product context - than while in the Cart Orderline context - this loop should not be accessible.

 

 

 

 

You must be logged in to post in the forum