0

Let me preface this by saying that I am not a developer; I am selling a hardware product online. In order for customers to buy this product, they first need to consent to several agreements (Terms of Use, etc.). This is to protect my business so if I get sued in 3 years, I can have documentation to show in court.

My website is a Wix website (eCommerce Plan). I'm currently using Stripe to handle payment processing. I'm looking for a way to (1) have a checkbox that must be checked (mandatory) before a customer can complete an order, and (2) an automatically-generated PDF sent to my email that contains (a) all of the documents they agreed to (including all text), (b) buyer name (c) date (e) time (f) IP address, and (g) order form.

If you can provide a solution for this, I'm sure you will be able to make a lot of people, like myself, happy.

thank you

chessrp
  • 1
  • 1

1 Answers1

1

The first question is easier than the second.

You're going to have to use Wix Code in order to add a conditional statement to check whether the box has been ticked. It also depends on whether or not you're using Wix Stores. It would look something like this without Stores.

export function makePayment($w,event){

if(!$w('#checkbox1).checked)){
//This simply says if the checkbox is not ticked, don't even bother continuing. 
//If it is, do what's inside the curly brackets.

requestStripe(...);
}

If you are using Wix Stores, there is currently no way to get the order details, however, they are working on exposing it in their API.

The second question is much more complex, because you need to access two custom API calls via the backend code; one to a PDF generator API like PDFKit and one to an email service, like SendGrid. Wix does not handle custom email sending directly from their service.

Hope this helps, let me know if you have any more questions.

Chris - Jr
  • 398
  • 4
  • 11
  • I tried to implement your code in WixCode, but it didn't work (either it didn't like your code or I put it in the wrong spot). Could you please provide more detailed instructions on how to do this? – chessrp May 16 '18 at 21:10