Hi DW,
In the Unifaun shipping provider we are using a delivery method called PostNord DK MyPack Collect with srvid P19DK. This method requires a contact name in receiver.contact. If this field is not filled out, then our client must do manually for all shipments using this method.
We would like the order.CustomerName in receiver.contact.
It should be pretty simple to add this field. We have looked into OrderDocumentSetOrderValues.cs in the Dynamicsweb.eCommerce.Cart.ShippingProviders namespace:
if (!string.IsNullOrEmpty(this.order.DeliveryAddress) || !string.IsNullOrEmpty(this.order.DeliveryAddress2))
{
if ((this.controller.ShippingDocumentServiceID == "PDKEP") && (!string.IsNullOrEmpty(this.order.DeliveryCompany) || !string.IsNullOrEmpty(this.order.CustomerCompany)))
{
this.SetValue("receiver.name", string.IsNullOrEmpty(this.order.DeliveryCompany) ? this.order.CustomerCompany : this.order.DeliveryCompany);
this.SetValue("receiver.contact", string.IsNullOrEmpty(this.order.DeliveryName) ? this.order.CustomerName : this.order.DeliveryName);
}
else
{
this.SetValue("receiver.name", string.IsNullOrEmpty(this.order.DeliveryName) ? this.order.CustomerName : this.order.DeliveryName);
this.SetValue("receiver.contact", string.Empty);
}
this.SetValue("receiver.address1", this.order.DeliveryAddress);
this.SetValue("receiver.address2", this.order.DeliveryAddress2);
this.SetValue("receiver.city", this.order.DeliveryCity);
this.SetValue("receiver.zipcode", this.order.DeliveryZip);
this.SetValue("receiver.country", this.order.DeliveryCountryCode);
this.SetValue("receiver.phone", string.IsNullOrEmpty(this.order.DeliveryPhone) ? this.order.CustomerPhone : this.order.DeliveryPhone);
this.SetValue("receiver.email", string.IsNullOrEmpty(this.order.DeliveryEmail) ? this.order.CustomerEmail : this.order.DeliveryEmail);
string str = string.IsNullOrEmpty(this.order.DeliveryCell) ? this.order.DeliveryPhone : this.order.DeliveryCell;
if (string.IsNullOrEmpty(str))
{
str = string.IsNullOrEmpty(this.order.CustomerCell) ? this.order.CustomerPhone : this.order.CustomerCell;
}
this.SetValue("receiver.sms", str);
}
else
{
if ((this.controller.ShippingDocumentServiceID == "PDKEP") && !string.IsNullOrEmpty(this.order.CustomerCompany))
{
this.SetValue("receiver.name", this.order.CustomerCompany);
this.SetValue("receiver.contact", this.order.CustomerName);
}
else
{
this.SetValue("receiver.name", this.order.CustomerName);
this.SetValue("receiver.contact", string.Empty);
}
this.SetValue("receiver.address1", this.order.CustomerAddress);
this.SetValue("receiver.address2", this.order.CustomerAddress2);
this.SetValue("receiver.city", this.order.CustomerCity);
this.SetValue("receiver.zipcode", this.order.CustomerZip);
this.SetValue("receiver.country", this.order.CustomerCountryCode);
this.SetValue("receiver.phone", this.order.CustomerPhone);
this.SetValue("receiver.email", this.order.CustomerEmail);
this.SetValue("receiver.sms", string.IsNullOrEmpty(this.order.CustomerCell) ? this.order.CustomerPhone : this.order.CustomerCell);
}
If the two lines with yellow background color are changed to the following we should be good:
this.SetValue("receiver.contact", this.order.CustomerName);
This would be very helpfull for us and maybe others as well. Do you think this is possible?
Best regards,
Martin