www.uburst.com www.uburst.com

"Two different prices, image button"

Go back to the LobbyClick here to Go Back to Main ListingClick here to see helpClick here to Search the Forum

Programmer Tips
Forum Type: Public
Moderator: edmunds
Time Zone: EST
Printer Friendly Format
Original Message
 
"Two different prices, image button"
Posted by kepitech on May-08-02 at 03:05 AM (EST)
I have two option lists, the first one is the size, the second one is the flavor. Since I use my own image button, I am using javascript function instead of the given applets.

I just can't seem to figure out how to have two different prices based on the size, and also use the image button i created to add it to the shopping cart.

Thank you

Click to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents

 Table of Contents

RE: Two different prices, image but..., Bill Weiner, May-08-02, (1)
Got it to work, kepitech, May-09-02, (2)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "RE: Two different prices, image button"
Posted by Bill Weiner on May-08-02 at 05:42 AM (EST)
I don't know the form field names that you are using... but here is at least one way to set the price based on the size:

In your add function, first determine the selected size with something like this:

var size = document.P00004.size.options[document.P00004.size.selectedIndex].value;

(The above line should be on just one line.)

Next initial a price variable, such as:

var price = "$0.00";

Use a "if" statement to set the price accordingly, such as:

if (size == "Large")
{
price = "$15.00";
}
else if (size == "Medium")
{
price = "$12.00";
}
else
{
price = "$10.00";
}

And then just use the "price" variable in the uShopJSI.addProduct() call.

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
2 . "Got it to work"
Posted by kepitech on May-09-02 at 04:56 AM (EST)
Thank you!!

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents


Archive This Thread: Admin and Moderator OnlyRemove This Thread: Admin and Moderator Only
Click here to goto Click here to goto the Lobby

 

 

 

 

 

 

 

 

 

 

 

 
Questions or problems regarding this bulletin board should be directed to Webmaster
©1997-1999 by DCScripts. All rights reserved.