Hello,
I am trying to get the total payable amount using span id=total-payable. It is returning 0, I tried many different ways but still retuning 0. When I debug the code I see that span#total-payable has the total value not 0. Can you please let me know why the id is returning 0? how can I get the total value?
Thank you!
- MSAnswered
Hello,
If javascript you can get the amount with
grand_total
variable. You can tryconsole.log(grand_total);
in console to print the value.Thank you
- RAnswered
Thank you for the fast reply. it didn’t work, I tried to check the value by using alert but still the code didn’t work. I tried to replace it in my Square code and still didn’t work. Any idea why?
- RAnswered
The code to pass the value is the following var data = { amount_money: { amount: pay, currency_code: “USD” }, pay has to be a string. inString() didn’t work so I am assuming the grand_total doesn’t have a value or we aren’t accessing it correctly.
- RAnswered
Also, just to confirm the code should be inside index.php with this path themes/default/views/pos/index.php? correct?
- RAnswered
no worries, I was able to pass it in a different way! thank you!
- MSAnswered
Hello,
The variable is declared in the index.php file and it should be available.
I am glad to know that you have found the solution.
Thank you for updating
- Login to Reply