close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

logic question regarding shipping calculation

Thread began 7/06/2016 9:28 am by Christopher West | Last modified 7/12/2016 2:15 pm by Christopher West | 2573 views | 9 replies

Christopher WestCommunity Expert

logic question regarding shipping calculation

Hey quick question regarding the same sake of the Question Topic (above).

I plan to have the following structure
Basket - This will include basket summary and form to enter a coupon code.
Checkout - This will just include a form for billing/shipping details and card payment details
Confirm - this does all the paypal communication stuff
Success - This page will display thank you message and include server behaviors for email and adding order to database.

For shipping calculation I plan to place all the calculation in a separate hidden php file. I assume the best way to accomplish this, is on the checkout page when a customer enters the postcode for shipping, it will access the separate hidden php file and then return the calculated shipping cost as a session variable. I assume I would either do some kind of AJAX call to this file, or some type of inline javascript on the form field in question (kind of like an onclick event - but obviously when a customer clicks out of the input field?

The alternative option is to place the shipping postcode form field on the basket page. But then obviously with this method the customer could easily type in any old postcode on the basket page which can be different to the postcode they enter on the checkout page (I could prevent this by storing the post code as a session and then adding this postcode session variable on the checkout page and making the postcode form input read only.

Which would be the best method from described above? or is there an alternative that I haven't thought of?

NOTE: the postcode calculation will take only the first 2 characters of the customers delivery postcode, since the shipping companies use the first 2 characters of the postcode to associate with a shipping zone.


Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...