Guys, im a business owner, i dont know how to code, but im trying to because you gotta do what you gotta do. Below is what I have done:
export function numofcoke_change(event) {
let NumofCoke = $w(‘#numofcoke’).value;
let PriceofCoke = Number(120);
$w(‘#totalpriceofcoke’).text = (NumofCokePriceofCoke).toString();
let TotalSumC = $w(‘#totalpriceofcoke’).text;
}
export function numofsprite_change(event) {
let NumofSprite = $w(‘#numofsprite’).value;
let PriceofSprite = Number(120);
$w(‘#totalpriceofsprite’).text = (NumofSpritePriceofSprite).toString();
let TotalSumS = $w(‘#totalpriceofsprite’).text
}
export function numofwater_change(event) {
let NumofWater = $w(‘#numofwater’).value;
let PriceofWater = Number(85);
$w(‘#totalpricew’).text = (NumofWater*PriceofWater).toString();
}
Now where im getting stuck is that i need to add the “totalpriceofcoke” and "totalpriceofsprite and “totalpricew”. I tried write below the script $w (‘#totalsum’).text = (adding all the above with + signs) but that doesnt work. it doesnt pick it up as its in a different function.
I also tried somehow taking them to the global area on the top but it doesnt pick it up there either. I DONT KNOW WHAT TO DO…HOW DO I CALCULATE THE SUM OF ALL THESE AND WHERE DO I PUT WHAT IN WHAT PART OF THE SCRIPT. I also tried adding a bracket open to the top and then write the code and bracket closed at bottom but that dont work either. PLEASE HELP ME!!!..