Alrighty. So basically I've been trying to implement dynamic attribute pricing into my website for a while now. If you don't know what I mean by "dynamic attribute pricing" (I basically just made up the phrase) here's a rundown of what I mean:
You have three radio button attributes. Attribute A is +$5, Attribute B is +$7 and Attribute C is +$10. When you click Attribute A $5 is added to the price, but Attribute B still says +$7, even though its not $7 greater than the new price. Dynamic attribute pricing would change the Attribute B to +$2 and Attribute C to +$3 (and if you selected Attribute B, Attribute A would change to -$2 etc etc.)
I understand that javascript is necessary in doing this. And I have the javascript necessary. I just don't know how to impliment it into the website.
Is there anyone out there who can help me at all? I've been looking to put this into my website for a while now, and feel that it is pretty crucial to my website functioning.
The Coding
Here's what I've figured will work:
First, need to set the base attribute price in a javascript file:
Code:
var basePrice = 10;
function makePrice(val){
productPrice = basePrice + val;
}
Second, need to set the attributes to change based upon the baseprice
Code:
<input type="radio" name=".." value=".." onclick="makePrice(10);">
Bookmarks