Ive made a website with Drupal that allows my client’s customers to book a courier. Bookings are nodes that registered users can create, with fields for destination, time, etc.

My client would like to be able to edit these nodes and add a ‘distance’ field, so im going to add another CCK field for this. They would also like a ‘price’ field to be calculated based on distance rate eg:

1-10 km = $10 per km
11-20 km = $8 per km
20+ km = $5 per km

So 15 km would be (15 x 8) = 120.

This is the part of the system I need to outsource. I dont mind if the calculation is client side with javascript and written to the CCK field so the node then has to then be saved, or if its all server-side.

Also the rate table will need to be changeable by the user. The new rates will apply to new booking nodes, not previously created ones.

There are 3 types of bookings. First is the normal booking. The 2nd is a return journey, where the 2nd half of the trip has 25% off the price.

The 3rd is a multiple address booking, where the rate is calculated for each individual part of the journey and the total is added together eg;

1 km, 7km, 12km =
(1 x 19) + (7 x 10) + (12 x 8) = 185

I need a quote to pass along to my client. Id also like to have a quick phone call / skype chat before continuing to make sure the project is understood.
Thanks

Comments

websule’s picture

Hi,

You can put your calculation formula in a field using http://drupal.org/project/computed_field (this will provide tokens to grab values of other fields like distance and weight).

I can help you get it implemented. Let me know if you would need skype assistance.