Payment from variable amount

@andy1066

Looking at your small page screenshot, you would be better off doing the price calculation seperately and then simply just taking the total price for the payment.

You can use Nayeli’s own example here to calculate items on your page.
https://support.totallycodable.com/en/article/create-simple-math-calculations-or-instant-online-quote-using-wix-code

Also, see here for a basic video example of calculating fields using code from Andreas Kviby, although please take note that Andreas is not connected with Wix anymore so please do not try to contact him as you will not get a reply.

https://www.youtube.com/watch?v=bHgIGptJYrA
Code for example above.

// For full API documentation, including code examples, visit http://wix.to/94BuAAs

let nrOfPeople = 0;
let nrOfTotalTickets = 0;

let totalSum = 0;

$w.onReady(function () {
 
});

export function addButton_click(event) {
 nrOfPeople = Number($w("#nrOfPeople").value);
 let ticketPrice = Number($w("#ticketTypeDropdown").value);
 let nrOfTickets = Number($w("#nrOfTickets").value);
 if (nrOfTotalTickets < nrOfPeople) {
  // Add
  totalSum += ticketPrice*nrOfTickets;
  nrOfTotalTickets = nrOfTotalTickets + nrOfTickets;
  $w("#totalSumLabel").text = totalSum.toString();
  console.log(totalSum);
  console.log(nrOfTotalTickets);
 } else {
  $w("#messageText").text = "You have all the tickets your family needs!";
  $w("#messageText").expand();
 }

You can also have a look at these examples from Vorbly that are for calculations too.
https://www.vorbly.com/Vorbly-Code/WIX-CODE-CALCULATIONS---MULTIPLY-NUMBERS
}https://www.vorbly.com/Vorbly-Code/WIX-CODE-CALCULATIONS---SUM-NUMBERS
https://www.vorbly.com/Vorbly-Code/WIX-TABLE-SUM-VALUE-FROM-DATABASE