## Free, outstanding support from WebAssist and your colleagues

Thread began 8/11/2010 10:49 am by vjc111265867 | Last modified 9/02/2010 8:33 am by Jason Byrnes | 1318 views | 5 replies |

## 8/11/2010 10:49 am  |  #1 vjc111265867

I need to add a charge to a cart if the user selects a dark color. I am setting up the charge to see if the item DarkColor is present in the cart and then using the calculation "based on column subtotal and and I am multiplying Quantity by \$3.00.

No luck in getting this into the cart.

Was wondering if I am checking for the right item. There is an item in the cart called DarkColor, but should I be checking for that item or the value contained in that item? ( which could be a number of different colors)

thanks nigel

## 8/11/2010 4:30 pm  |  #2 Eric Mittman

I think that it might be easier to use a calculation to add in this extra charge. You would want to have another column in your cart for a dark color type. When any of the dark colors are selected you could set this column to have a particular value to indicate so like 1.

If you had it setup like this you could alter the total price calculation to look at this column and if it is set to the value then use the price + 3 then multiply by the quantity or else just multiply the price by the quantity. It might look like this:

`abs(DarkColor == 1)?(([Price] + 3) * [Quantity]):([Price] * [Quantity])`

## 8/26/2010 6:19 am  |  #3 vjc111265867

### Trying to get this to work with another formula

Sorry Eric for taking so long to get back, but how would I get this to work with another calculation I had to write for dealing with lowering prices based on the quantity the user selects. The formula below is working great:

(abs([Quantity]>0 && [Quantity] <= 23) * ([Price] * [Quantity])) + (abs([Quantity]>23 && [Quantity] <= 47) * ([Price]Range1 * [Quantity])) + (abs(Quantity>47 && [Quantity] <= 131) * ([Price]Range2 * [Quantity])) + (abs(Quantity>131 && [Quantity] <= 199 ) * ([Price]Range3 * [Quantity])) + (abs(Quantity>200 ) * ([Price]Range4 * [Quantity]))

I'm not sure where I plug in the calculation you gave me for dealing with dark colors?

## 8/27/2010 12:54 pm  |  #4 Jason ByrnesWebAssist

you should just be able to add it onto the end:

(abs([Quantity]>0 && [Quantity] <= 23) * ([Price] * [Quantity])) + (abs([Quantity]>23 && [Quantity] <= 47) * ([Price]Range1 * [Quantity])) + (abs(Quantity>47 && [Quantity] <= 131) * ([Price]Range2 * [Quantity])) + (abs(Quantity>131 && [Quantity] <= 199 ) * ([Price]Range3 * [Quantity])) + (abs(Quantity>200 ) * ([Price]Range4 * [Quantity])) + (abs(DarkColor == 1)?(([Price] + 3) * [Quantity]):([Price] * [Quantity]))

## 8/28/2010 12:22 pm  |  #5 vjc111265867

### Price is wrong

Jason, tried plugging the DarkColor Formula at the end of the others but the price was totally off. Do I need to somehow place it into each section of the quantity formula so the the \$3.00 is added to the price range that is based on quantity? If so how would I do that syntax wise?

## 9/02/2010 8:33 am  |  #6 Jason ByrnesWebAssist

i see, you would need to modify the conditions and use the abs function where the price is added.

for example:
(abs([Quantity]>0 && [Quantity] <= 23) * ([Price] * [Quantity]))

should be changed to:
(abs([Quantity]>0 && [Quantity] <= 23) * ((abs(DarkColor == 1)?[Price] + 3:[Price]) * [Quantity]))

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