Forum

Thread tagged as: Question, Shop

perch shop checkout process

I am trying to build 1 page checkout for a customer, so after cart page when user clicks on "checkout", here is how he expects the page to behave.

case 1: user is taken to a page where he can enter username and password, or ignore those fields and go straight to entering shipping address and click on "pay now" button, this button action should save address in db and continue to opening payment (for .e.g. stripe payment popup may show up).

case 2: if the user selects to enter username and password, then I want the address below to pre-populate with their last shipping address entered or if it can populate from a custom database query (from non-perch tables). and allow user to follow same flow as above (he can edit the address and click on 'pay now')

Can someone help with some suggestions please.

sawan ruparel

sawan ruparel 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You'll need to figure out how you're going to deal with the form submitting to two different places at once. You might need to save the address with an XHR request.

XHR request sounds good.

I am able to complete checkout with signin.

however without signin, it does not work for me.

I am also not sure how show user last entered address in the format where user can also edit the address while also completing the order.

Drew McLellan

Drew McLellan 2638 points
Perch Support

What's your question?

question: what are the right page functions i could use to make it work ?

I am a little confused how to lay it out

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't know. What you're doing isn't how it's designed to work.