Unfunctional Payment

I’m having trouble with
I’m creating funnel pages in Wix - I have everything created but I can’t get past the payment. When selecting checkboxes (order form for online course), it nicely calculates the price of the selected items in the course, but when I click to pay (via the WixPay button), in the checkout it shows an item and price of 1 CZK (item values are from 990 CZK to 2499 CZK). I can’t get the value of the selected items there (the value of the entire order is simply the sum of items at different prices).

Working in
Wix Editor, Dev Mode

Site link
www.eat4life.cz/online - pass praha

What I’m trying to do
I would need advice on how to set it up so that the total price (based on what’s selected) is displayed at the checkout and the payment process proceeds.

Thanks

You have not mentioned ‘how’ you are calculating the total price and how you have set up your payment button. It was only when I dug in a little deeper did I find out that you have written Velo code to run the calculation logic (which btw has two onReady() functions - not recommended), and in the button’s onClick() event handler, this is the only line of code you’ve got:

$w('#button59').onClick(() => {
  console.log("Počítaná suma (nedostane sa do platby):", total);
});

All you are doing is logging the calculated price to the console, you are not ‘passing’ the total to Wix Pay for it to appear in the checkout. It seems that you have just linked the button through the editor, and hence the output.

So here’s what you need to do:

  • Remove any links to the button from the editor. This will need to handled completely using code.
  • Study the wix-pay-backend and frontend API. Go through the examples provided for the createPayment() function and then start the payment flow on button click.
  • Watch this tutorial by @thewixwiz which will help you get a hang of it:
1 Like