Developer forum

Forum » Ecommerce - Standard features » Premium Shipping Charges Scenario

Premium Shipping Charges Scenario

Tan Pang Lin Dynamicweb Employee
Tan Pang Lin
Reply

Hi

Below is our customer's requirement, any idea what would be the best way to configure it.

1.  The default delivery charge would be 50 if order is below 200, otherwise is free.   This is for normal working day and during office hour delivery.

2.  However, if the chosen delivery date is a Public Holiday or Sunday, or the time slot chosen was after office hour, customer had to pay 20 more.  That is to say if the order amount is below 200, customer pay 70, if the order amount is more than 200, customer pay 20.

For point 1, I can use shipping fee to handle.  

but for point 2, I am not sure what is the best way to customize it.  Any advice?

 

Thanks

Pang Lin


Replies

 
Nicolai Pedersen
Reply

Hi Pang Lin

I can only see a way to this to code some logic into the checkout template...

Sorry about the late answer.

BR Nicolai

 
Tan Pang Lin Dynamicweb Employee
Tan Pang Lin
Reply

Thanks Nicolai.

May I know do you have any idea how should be the coding like?

Would it be possible to have this as an enhance feature?

This "surcharge" is very common in small country like Singapore which customer is willing to pay extra for express delivery.

Thanks

Pang Lin

 

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Pang Lin

You can create multiple shipping methods and do some ruling in the template to see if it is Sundaya and force a change of shipping method based on that.

Another option - probably the best, is to use a fee provider:

 class FeeProviderSample : Dynamicweb.Ecommerce.Orders.FeeProvider
    {
        public override Dynamicweb.Ecommerce.Prices.PriceRaw FindFee(Dynamicweb.Ecommerce.Orders.Order order)
        {
            System.DateTime chosenDeliveryTime = (System.DateTime)order.OrderFieldValues.GetOrderFieldValue("CustomOrderFieldDeliveryDate").Value;
            if (chosenDeliveryTime.DayOfWeek == System.DayOfWeek.Sunday)
            {
                Dynamicweb.Ecommerce.Prices.PriceRaw sundayFee = new Dynamicweb.Ecommerce.Prices.PriceRaw();
                sundayFee.Price = 20 + order.ShippingFee.PriceWithVAT;
                sundayFee.Currency = order.ShippingFee.Currency;
                return sundayFee;
            }
        }
    }

Votes for this answer: 1

 

You must be logged in to post in the forum