close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Shirt Size Determines Price

Thread began 4/27/2009 3:52 pm by chris199437 | Last modified 9/04/2009 7:22 pm by Ray Borduin | 5119 views | 31 replies |

chris199437

Shirt Size Determines Price

I am using a static cart and I would like if the user chooses 2XL it would give them a different price than if they would have chose a Medium size from a drop list. Please help.

Sign in to reply to this post

Ray BorduinWebAssist

I'd probably add a column called XLPrice to the cart, then update the price calculation to:

TotalPrice = (([Size]=="2XL")?[XLPrice]:[Price]) * [Quantity]

Sign in to reply to this post

chris199437

Thanks Ray, One more thing

I can't seem to have my display page update the items except quantity. I have a product and when you choose size then color then quantity and add to cart it's fine. But when I click Continue shopping and it goes back to that page it will only update the quantity and not a different size or color on my display page?

Sign in to reply to this post

chris199437

Now it won't load the page and gives me an error on line 167. Here is what is on line 167

itmObj.TotalPrice = ((itmObj.Size=="2XL")?itmObj.XXLPrice:itmObj.Price) * itmObj.Quantity'c

Sign in to reply to this post

Ray BorduinWebAssist

Do you have columns named "Size" and "XXLPrice"? This looks correct. What is the error you get?

Sign in to reply to this post

chris199437

Yes I do, here is the error

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
C:\INETPUB\VDWWWROOT\HOTCAKESINC.COM\FBB\../WA_eCart/FBB_Cart_Store_VB.asp, line 167, column 34

store1.asp

Sign in to reply to this post

Ray BorduinWebAssist

oh... vbscript. My answer would work in php or javascript, but not vbscript.

vbscript would be:
TotalPrice = ((abs([Size]="2XL")*[XLPrice])+(abs([Size]<>"2XL")*[Price])) * [Quantity]

Sign in to reply to this post

chris199437

Well the page will load now but it still does not show $38.25 for a 2XL it shows it as the $35.25 price (which is set for Price) (I have a column call XXLPrice and set it to 38.25). Please help??

store1.asp

Sign in to reply to this post

Ray BorduinWebAssist

OK, you probably want to add calculations like this:

TruePrice = ((abs([Size]="2XL")*[XLPrice])+(abs([Size]<>"2XL")*[Price]))
TotalPrice = ((abs([Size]="2XL")*[XLPrice])+(abs([Size]<>"2XL")*[Price])) * [Quantity]

Then on your page show the value of TruePrice instead of Price and it should work. Is the column total correct now?

Sign in to reply to this post

Ray BorduinWebAssist

You will also want to mark size and color as unique columns in the cart columns section.

Sign in to reply to this post
loading

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