close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Database driven shipping

Thread began 10/05/2010 4:15 am by Badger | Last modified 11/04/2010 9:58 am by Badger | 2388 views | 32 replies

Jason ByrnesWebAssist

don't go by the recipe, it wont really help you in this case, except as a guide for the basics of creating filtered recordsets and using the set session value server behavior.


from you description, it sounds like you need the following columns in your table:

shipingRateID - Primary Key, Auto Number
shippingRateCountry - 2 letter country code: GB, US AU etc.
shippingBase - this will store the base rate for the country, 6.75 for GB
shippingIncrement - the increment for the country, 0.26 for GB
shippingFuelPercentage - the fuel charge, .13 for GB


on the confirm page, create a shipping rate lookup recordset.

Set the filtering options to filter the shippingRateCountry equal Form Variable 'shipping_country'

Now add 4 Set Session Value server behaviors, one for each of the columns in the shipping table except the ID:
shippingRateCountry
shippingBase
shippingIncrement
shippingFuelPercentage

In each of them, set the trigger to Any Form Post.

Set the name to be the same as the database column

Click the lightning bolt next to value and select the corresponding column from the recordset.


Now in the cart object, you can create the shipping calcualation to use the session variables created:

ShippingCost:

$_SESSION['shippingBase'] + (abs(([Weight] * [Quantity]) > 10)?floor(([Weight] * [Quantity] - 10) / 0.5) * $_SESSION['shippingIncrement']:0) + ($_SESSION['shippingFuelPercentage'] * ([Price] * [Quantity]))




then on the shipping tab, create a new shipping charge. set the trigger to:
Subtotal for any column:
ig the subtotal for the column 'total weight' is '>' a value of '0'

AND
Session Variable exists 'shippingBase'

AND
Session Variable exists 'shippingIncrement'

AND
Session Variable exists 'shippingFuelPercentage'

Calculation:
Based on column subtotal:
Subtotal of Column 'ShippingCost' 'plus' '0'

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

Content

rating

Layout

rating

Ease of use

rating

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...