# Customizing the shipping rate

Thread began 6/16/2010 7:08 am by dave403891 | Last modified 6/16/2010 11:58 am by dave403891 | 785 views | 4 replies |

## 6/16/2010 7:08 am  |  #1 dave403891

### Customizing the shipping rate

I need to have a shipping rate based on the subtotal of all products in the cart that equals a minimum of \$4 or 10% whichever is higher. I entered the following code in the eCart Object calculations, but it calculates on each line item rather than the subtotal.

For example, if I have three items at \$15 my subtotal is \$45 and shipping should be \$4.50. I now get shipping at \$12.00 or \$4 for each item based on item totals rather than the subtotal of all items.

Here's my current code: ((([Price] * [Quantity]) * 0.10) > 4)?(([Price] * [Quantity]) * 0.10):4 How do I adjust this to get what I'm looking for?

## 6/16/2010 11:05 am  |  #2 Jason ByrnesWebAssist

don't do this on the calculation tab, as you have discovered, calculations are applied on a line item basis.

Instead, do this on the shipping tab.

Create a new shipping rule:

trigger:
based on number of unique items in the cart > 0

calcualtion:
Flat Rate calculation of:
((\$this->TotalColumn('TotalPrice') * 0.1) > 4)?\$this->TotalColumn('TotalPrice') * 0.1:4

## 6/16/2010 11:28 am  |  #3 dave403891

Jason,

Got the first part. But have a question here:

calcualtion:

Flat Rate calculation of:
((\$this->TotalColumn('TotalPrice') * 0.1) > 4)?\$this->TotalColumn('TotalPrice') * 0.1:4

I don't see a place after Flat rate selection in the shipping tab to insert the calculation code.

Does this go in the calculation tab and if so what goes in the calculation section of the shipping tab?

## 6/16/2010 11:35 am  |  #4 Jason ByrnesWebAssist

when you select flat rate, there is a text box to enter the flat rate:
Create a Flt rate Shipping of \$[text box]

enter that code in the text box
Create a Flt rate Shipping of \$[((\$this->TotalColumn('TotalPrice') * 0.1) > 4)?\$this->TotalColumn('TotalPrice') * 0.1:4]

(Without the square brackets, I am using them to illustrate the text box)

## 6/16/2010 11:58 am  |  #5 dave403891

Jason,

Everything is working. Many Thanks

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

## Everything else!

Close Window

Account or customer service questions?

Need technical support?

Content

Layout

Ease of use

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 Window

## We were unable to retrieve the attached file

Close Window

### Attach and remove files

• Text Formatting
• Insert Element
• Block Formatting
• Cancel
Close Window

Close Window

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