close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Formula for shipping sizes

Thread began 5/13/2011 10:27 am by James L | Last modified 5/16/2011 7:19 am by Jason Byrnes | 1063 views | 3 replies |

James L

Formula for shipping sizes

My client has a product that is available only in quantities of 1, 2, or 3. A single item ships in a box 8"x5"x5". But 2 or 3 items will ship in a box 14x8x5. In the checkout wizard for UPS shipping one must list the length, width, & height. I see that the lightning bolt lets me connect to a field, so I added three fields to "Items" -- ItemLength, ItemWidth, & ItemHeight. Is there a way to dynamically populate these fields with a size based on the Quantity?

Sign in to reply to this post

Jason ByrnesWebAssist

so only the height and width will change.

Create 2 calculations in the eCart object:

height:
abs([Quantity] == 1)?[ItemHeight]=8:[ItemHeight]=14

width:
abs([Quantity] == 1)?[ItemWidth]=5:[ItemWidth]=8

hard set the length at 5.

Sign in to reply to this post

James L

this doesn't seem logical to me. There's no accounting for the 1 item box and the 2-3 items box. Should it not be something like:
abs([Quantity] == 3)?[ItemHeight]=8:[ItemWidth]=14
abs([Quantity] == 2)?[ItemHeight]=8:[ItemWidth]=14
abs([Quantity] == 1)?[ItemHeight]=8:[ItemWidth]=5

Sign in to reply to this post

Jason ByrnesWebAssist

the calculation is using a ternary expression.

a ternary expression is a shortened if statement using the following format:

expresion?true statement:False statement

in other words, this statement:
height:
abs([Quantity] == 1)?[ItemHeight]=8:[ItemHeight]=14

means:
Quantity == 1?

yes: Set the Item Height to 8

No: Set the item height to 14

the height be set to 14 if the quantity is anything other than 1. Set the quantity to 2 or 3, the height will be set to 14

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