how to calculate label values in an array
Hi Michael,
'Star Pizza' seems to be another application. Are you sure it's 'Star Pizza'? We do not see any service handlers on 'checkout' page.
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Hi Michael,
'Star Pizza' seems to be another application. Are you sure it's 'Star Pizza'? We do not see any service handlers on 'checkout' page.
Hi Michael,
[quote:]Price is not defined.[/quote]Where do you declare 'Price' variable? Please note 'price' and 'Price' are different names.
Michael,
This is because you don't have a variable named "price".
There is also a typo. Please replaceprea.lenght/prewithprea.length/pre
When you add variables to localStorage, you should call them next:pre localStorage.getItem("name");/pre
where name - name of variable.
In your case better to add this lines before your code:
pre
var price = localStorage.getItem("price");
var extrasprice = localStorage.getItem("extrasprice ");/pre
Hello! As you need arrays, not strings replace prevar price = localStorage.getItem("price");
var extrasprice = localStorage.getItem("extrasprice ");/pre with prevar price;
try {
price = JSON.parse(localStorage.getItem("price"));
if ({}.toString.call(price) !== "[object Array]") {
price = [];
}
} catch ( e ) {
price = [];
}
var extrasprice;
try {
extrasprice = JSON.parse(localStorage.getItem("extrasprice"));
if ({}.toString.call(extrasprice) !== "[object Array]") {
extrasprice = [];
}
} catch ( e ) {
extrasprice = [];
}/preAs we can see from your last error screenshot you don't have price localStorage variable. Please check localStorage variable name (note it's case sensitive). Check if it's saved correctly.