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.
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.
I'd probably add a column called XLPrice to the cart, then update the price calculation to:
TotalPrice = (([Size]=="2XL")?[XLPrice]:[Price]) * [Quantity]
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?
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
Do you have columns named "Size" and "XXLPrice"? This looks correct. What is the error you get?
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
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]
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
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?
You will also want to mark size and color as unique columns in the cart columns section.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.