close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

eCart calculation

Thread began 10/15/2009 12:34 pm by Fritz Stickers | Last modified 11/24/2009 10:36 am by Eric Mittman | 3249 views | 7 replies |

Fritz Stickers

eCart calculation

Hi,

The price for a product increase with 2,00 euro when the size increase with 5 cm.
The minimum price is 6,00 euro for 15 cm, so 20 cm=8,00; 25 cm=10,00; 30 cm=12,00.
WA_eCart calculation : [Price]+(((([Size]-15)/5)*2))

Now I want the price increase with just 1,00 euro from size 35 cm, so that 35 cm=13 euro.

How do I have to make the calculation ?


Regards,
Geert.

Sign in to reply to this post

Eric Mittman

I was looking into this one for a moment and I think I have a calculation that will work for you.

The idea I was working with is that there is a max of 6 euro that will be added to the minimum price if the size is 30 or greater using your posted calculation. So I just made a calculation that checks if it is over 30cm and if so add 1 euro for each 5 cm over 30cm, then also add 6 euro to account for the maximum charge for the first calculation. If it is 30cm or less then just use the original calculation. Here is the calculation code:

[Price]+ (abs([Size] > 30) * ((([Size]-30)/5) + 6)) + (abs([Size] <= 30) * ((([Size]-15)/5)*2))

Please give this a try and let us know if it works for you. Sorry if my explanation of the code is confusing.

Sign in to reply to this post

Fritz Stickers

Thanks Eric,

Calculation works fine !


Geert.

Sign in to reply to this post

Eric Mittman

That is good to hear, I was hoping it would work for you. It took me a minute or two to review it and test it.

Sign in to reply to this post

Fritz Stickers

Hi,

I want to change the calculation a little bit :

[Price]+ (abs([Size] > 30) * ((([Size]-30)/5) + 6)) + (abs([Size] <= 30) * ((([Size]-15)/5)*2))

I want also the price decrease 1 euro if size is 10 cm.

10 cm = 5,00 (-1,00)
15 cm = 6,00 (= 6,00)
20 cm = 8,00 (+2,00)
25 cm = 10,00 (+4,00)
30 cm = 12,00 (+6,00)
35 cm = 13,00 (+7,00)
40 cm = 14,00 (+8,00)
45 cm = 15,00 (+9,00)


I tried a lot of combinations for the calculation, but non of them works.
([Price]+ (abs([Size] = 10) * (([Size]-15)/5)) + (abs([Size] <= 30) * ((([Size]-15)/5)*2)) + (abs([Size] > 30) * ((([Size]-30)/5) + 6))))

Can you give it a try ?


Geert.

Sign in to reply to this post

Fritz Stickers

I found it at last :

- 1 euro < 15 cm
+ 2,00 euro = 20,25 of 30 cm
+ 1,00 euro > 30 cm

([Price]+ (abs([Size] < 15) * (([Size]-15)/5))
+ (abs([Size] = 20) * ((([Size]-15)/5)*2))
+ (abs([Size] = 25) * ((([Size]-15)/5)*2))
+ (abs([Size] = 30) * ((([Size]-15)/5)*2))
+ (abs([Size] > 30) * ((([Size]-30)/5) + 6))))

Sign in to reply to this post

Office Guy-172461

Thanks to both of you for sharing your formulas.

Calculation for price increase based on size
169/

Sign in to reply to this post

Eric Mittman

Nice write up on this, I bet this will come in handy for others out there. Thanks.

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