Jump to content

custom php and js checkout solution


fruid
 Share

Recommended Posts

I need some basic checkout functionalities…

- add to cart
- change amount or delete
- enter shipping/billing address
- choose payment option (paypal or deferred payment)
- see order overview with button "zahlungspflichtig bestellen" (required by Austria and German law)
- submit order

Also need adjustable layout.

No fancy stuff like "customers also bought" or "last viewed items" or login functionalities or whatnot.

What are the options in the PW-universe? What do you use? Don't suggest SnipCart though, I tried it before and it's overkill, and therefore it's not worth the price.

Thanks for help!

Link to comment
Share on other sites

32 minutes ago, fruid said:

I had a feeling someone would bring that up. And then, what if I write my own custom solution, would that be wise?

I have tried that twice. The first try was for a client and I implemented everything in PHP. That kind of worked and it still works... But I don't really like the solution because it feels very old-school. The second one was a great implementation using alpinejs for reactivity for the cart, very similar to snipcart. Very nice gui and look and feel (using uikit). I wanted to use snipcart first, but I was not able to get that running with things that seemed to be quite common requirements. So I started building my own solution. But the project was never finished. So we kind of failed with that second try.

What I realized: I totally underestimated all the things that are necessary to build such an "easy cart + checkout" thing... And I guess it was the same thing for padloper1 (which was abandoned) and padloper2 (which was delayed for a year or so?). That's no offense in any way, it's just a warning that you might be underestimating things as well ? 

Take the screenshot below: What if the user wants to change the cart at that step? What if he/she enters wrong details? What if you need coupons? What if the payment fails? What if you need multiple languages? etc etc...

But if you want to build it, go ahead. I'm always a fan of doing things on your own.

4 hours ago, fruid said:

I tried it before and it's overkill, and therefore it's not worth the price.

I just have a feeling that this statement is a little... underestimating things... that's all ? I guess that both snipcart and padloper are easily worth their price ? 

PpantND.png

  • Like 7
  • Thanks 1
Link to comment
Share on other sites

Thanks a lot for the feedback, it all makes sense.

I am sure SnipCart is a good module in its own right, but for this client project that I have in mind, it's an overkill and not very suitable. Also, it's a Canadian company and hosted in Canada (?). So it seems like it's foremostly designed to work for American and Canadian standards, not so much for Austria and Germany. It also requires jQuery which is something I refrained from for the entire project (using Vanilla JS instead). So for this few functionalities that we actually need, it didn't make sense to not solve it locally and without jQuery. Moreover, my client despises any features that he doesn't absolutely need. 

That's why it felt like a good idea to build a custom solution. I thought how hard can it be when it doesn't need many functionalities (see above), it's almost like a contact form if you think about it. (To be fair, PayPal is also not local either but there's not much one can do about that.) At first I used the PayPal checkout express button which works like a charm, however, things changed around a bit. According to European law that PayPal Express Button is not compliant, you need to approve the order on the merchant's site, the button needs to have an exact wording and the user needs to see the order-overview before submitting.

So yes, I totally understand that I was or actually still am underestimating the workload of coding my own solution. At first it was much less but with said juristic requirements the workload got more and now I'm pretty deep into it, wondering if I should push through or reconsider, hence my asking. But I can also see now that the suitable alternatives are not more than I thought after all.

Link to comment
Share on other sites

actually the biggest problem I'm facing right now is handling server and client sessions. First you would authorise an order with PayPal, so on the server you do a cURL request to PayPal and it returns a link. This link you pass to the client (I do that in an AJAX response) and when the user clicks on that link, they get redirected to PayPal to approve the order. That works fine when everything happens in the same browser tab, the server session is the same throughout all tabs. But what if for some reason the user opens that link in a new tab or window? That would be a new client session which messes up the whole logic. Is that a valid concern? How can I manage the client sessions for this issue not to happen?

Link to comment
Share on other sites

A new tab isn't a new session - just like having PW frontend and backend open in different tabs - you stay logged into both, and any further tabs you might open. A new window might be (I haven't tested) but surely a user savvy enough to do that  will be savvy enough to expect adverse consequences (I would have thought anyway...).

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...