Hi there, I'm setting up a multiple outlet online food ordering website and have a question regarding delivery charge options...

Each individual outlet is going to have different delivery options, from FREE Delivery to £X cost. I simply would like to know how I include a simple piece of code that can be copied into each takeaways script, to stated that i.e. if the total order is over £8 then delivery charge is "0" if the total order is under £7.99 then a delivery charge of £1 is automatically added to the order price.

Many thanks

Justin

include('deliverycosts.php');

then have your calculation rules in deliverycosts.php as a function and call that function after getting total order.

in the function, you could have a switch case to detect which outlet it was, and then have all the costs defined in each case.

Could you please show coding example.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.