Developer forum

Forum » Ecommerce - Standard features » Contact in Unifaun shipping documents

Contact in Unifaun shipping documents

Martin Bakken Rickmann
Reply

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


Replies

 
Nicolai Pedersen
Reply

Hi Martin.

Seems like you are using 8 still...?

Attached an updated dll with your requested change. Copy the dll to your bin folder - will also be in next hotfix for 8 and 9.4.

It could impact solutions not using this exact delivery method - where you would have names twice - so a rollback could happen. I'll let you know if that is the case.

BR Nicolai

 
Nicolai Pedersen
Reply

TFS#48903

 
Martin Bakken Rickmann
Reply

Hi Nicolai,

Yes - version is 8.9.2.20 to be exact. I deployed and tested and everything works in our cases. Thx a lot for the quick response.

Best regards,

Martin

 

You must be logged in to post in the forum