close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Adding other charge from database field

Thread began 5/16/2011 8:12 pm by info271221 | Last modified 2/21/2012 10:21 am by info271221 | 1888 views | 7 replies

Jason ByrnesWebAssist

you would need to create a database table to contain each of these charges.

the table should contain only one record with a column for each charge set one column to hold the amount of the flat rate, set the other column to hold the percentage amount as a decimal, i.e. "0.10" for %10.

on the cart page, create a recordset to return the record from this table.

Go to the Server behaviors panel and click the plus button. select eCart -> General -> Set Session Value. set the trigger to "If session Variable is not defined", give the session a unique name like "FlatRate", click the lightning bolt next to value and select the flat rate column from the recordset.

Repeat this step for the percentage column to store the database values in the session variables.

In the eCart object, you can create the charges t use the session variables.

use the triggers:
Session Variable Exists:
Session Variable name "FlatRate"

And
Total number of unique items > 0

for the calculation use flat rate and enter:
$_SESSION['FlatRate']


for the percentage rule, use based on the cart subtotal:
subtotal "Times" "$_SESSION['percentage']

make sure to use the same names for the session variables as you use when setting them in the set session value behavior.

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