Developer forum

Forum » Rapido » Rapido add OrderlineAttachment field to cart

Rapido add OrderlineAttachment field to cart

Christoffer Rosendahl Frede
Reply

Hi

im currently trying to add a value to the Orderline Attachment when submitting the cart in a Rapido website.

first up, i have tried adding this input field to the Cart form:

<input type="hidden" name="EcomOrderLineAttachment" id="EcomOrderLineAttachment" value="some_filename" />

but that does not seem to do anything in the database.

i have alsto tried adding the orderline field to the cart json with some code similar to this:

cartOrderLine.attachment = orderline.GetString("Ecom:Order:OrderLine.Attachment");

but that also does not seem to do the trick.

Does anyone know how to set a value in  Ecom:Order:OrderLine.Attachment field in Rapido ?

Best regards Christoffer


Replies

 
Nicolai Pedersen
Reply

Hi Christoffer

Submitting the cart? Are you trying to update the value from the cart?

You add the value of an orderline field from add-to-cart from a product - see:

https://doc.dynamicweb.com/forum/templates/templates/orderline-field-not-added

Also remember to attach the orderlinefield to a group first: see https://doc.dynamicweb.com/documentation-9/ecommerce/product-catalog/product-groups#2702

BR Nicolai

 
Christoffer Rosendahl Frede
Reply

thanks Nicolai.

well i would like to save a value in the field OrderLineAttachment in EcomOrderLines, when the cart is submitted/order is created.

regarding the links you provided and adding orderline fields to a product group, i thought that this is only needed for custom orderline fields ?

and all the standard orderline fields like OrderLineOrderId is included as is? 

we also tried adding a custom orderline field, but the problem is, we cant select custom orderline fields in data integration - column mapping and we need that value in our order export.

that is why we have tried adding a value to the OrderlineAttachment field, as is is the ony "standard" orderline field we are not using and we can select it in the column mapping in the export.

 
Nicolai Pedersen
Reply

Ah - I missed that detail, sorry. I did not know the field!

Looking at the code, it seems that this field is not supported in the frontend at all - Dynamicweb will not pick it up, which is why you cannot use it. Must be from 'old days'...

I will bug it so it will be part of the checkout field. You can set it by code using OrderLine.Attachment = "Value" and then it will go into the database and be shown in the backend.

Sorry about the inconvenience!

BR Nicolai

 
Christoffer Rosendahl Frede
Reply

no problem!

well i did actually try that and i dont see any data on the database in the OrderlineAttachement field. i tried it with adding this: cartOrderLine.attachment = "value";

to the /json/Cart.cshtml file. and it does not seem to work.

i also found some other posts where people say it can be done with a custom orderlinefield and setting data like this:

<input type="hidden" name="EcomOrderlineFieldInput_TestMyField" value="testvalue" />

but this does  not work. i did add the custom orderline field to the productgroup and i did see that the field ORDERLINEFIELDVALUES did actually change.

when i look in the database i now have this below tag, but still missing the value inside it. 

am i not using the correct naming for the input field with EcomOrderlineFieldInput_SystemName ?

<OrderLineFieldValueCollection>
<OrderLineFieldValue>
<OrderLineFieldSystemName>TestMyField</OrderLineFieldSystemName>
<Value></Value>
</OrderLineFieldValue>
</OrderLineFieldValueCollection>

 

 

 

 

You must be logged in to post in the forum