close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Trying to add charges

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

vjc111265867

Trying to add charges

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

Sign in to reply to this post

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])
Sign in to reply to this post

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?

Sign in to reply to this post

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]))

Sign in to reply to this post

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?

Sign in to reply to this post

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]))

Sign in to reply to this post

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