Developer forum

Forum » Development » Shipping fee
Aksel Andersen
Reply

Hi folks.

 

I am creating a custom fee calcuation wich i am trying to implement in the cart module.

What i want to do is.

1) calculate fee according to weight and volume of the order.

2) generate and display the different delivery options with fee as radiobuttons. (In a separate step)

3) Save this fee to the order.

 

Whats the best way to attach this problem? (step by step?)

I have tried to use AfterShippingMethodIsChanged, BeforeShippingMethodIsChanged, BeforeRenderingNewStep.. and im using the feeprovider (which i am able to set the fee) My problem is that i cannot fetch the choices the user made about delivery and use this in the feeprovider.

I have one shippingprovider configured.

 

This was probably a bad explanation, but im not sure where to begin to make this work..

 


Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi Aksel,

 

I would recommend you take a look at the FeeProvider concept. A FeeProvider allows you to change the shipping fees according to whatever rules you wish to impose. You can find the documentation here: http://developer.dynamicweb-cms.com/documentation/for-developers/ecommerce/extensibility/providers/fee-providers.aspx

 

EDIT: Just saw you have tried the FeeProvider.

 

- Jeppe

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

What about:

Have the extra shipping options as Order Fields and let the FeeProvider react to whether those fields are set or not.

 

- Jeppe

 
Aksel Andersen
Reply

thanks Jeppe! I will give it a go. :)

 
Aksel Andersen
Reply

I cannot define an orderField as a radiobutton, so this will not work for me as the user should be able to choose one option. Any workaround for this?

 

Thanks! Aksel

 

You must be logged in to post in the forum