frappe / builder

Modern website builder for modern web pages
https://frappe.io/builder
GNU Affero General Public License v3.0
319 stars 93 forks source link

Shopping Cart #116

Open blaggacao opened 3 months ago

blaggacao commented 3 months ago

I wonder a bit what the way forward would be for Frappe deployments on the shopping cart implementation.

As I currently (2 days into exploring builder) understand it, it's relatively easy to efficiently query all sorts of data from the backend.

Beyond that, the frappe/webshop app implents a B2B store component for logged in users.

What seems to be missing is an anonymous ("lightweight") checkout experience, that works only with the cuatomer's email or phone number + some memoized browers-local key/coockie to authorize recovery of any ongoing or past transaction, but without formal registration.

batonac commented 3 months ago

I wonder if Frappe and Builder could be extended to enable apps to provide builder components that could help close this gap. I'm thinking the frappe/payments app could provide a payment form component, frappe/webshop a mini cart, main cart, and checkout components, etc.

blaggacao commented 3 months ago

Yes, indeed, the only limitation is that webshop doesn't allow "anonymous" (really: lightweight) checkouts, with say only an email or mobile phone.

That's a transaction killer in most b2c cases.

blaggacao commented 3 months ago

I wonder if one could "simply import" this webshop's js library into a builder page: https://github.com/frappe/webshop/tree/develop/webshop%2Fpublic%2Fjs , then write some bindings with the existing builder's scripting capabilities and have a working cart implementation 🤔

There are a couple of thoughts that I want to put down here:

To design the checkout freely with builder:

Checkout:

Server Session: either login session or dummy session (email field in checkout form - fingerprint) *

On success

* because even a debounced email input field is unstable (think: user correction), we should create a temporary user based on the (within the time horizon) more stable fingerprint. We can create those users as "throwaway users" garbage collected after say 30 days, bit which can be transformed into "real users" after signup. Of the email

If the email / phone ends up matching a real user, the checkout should show a password filed + a login button to establish an authenticated session, instead.

So far so good, brainstorming to be continued.

federicocalvo commented 3 months ago

Hi @blaggacao , there are so many threads with these interesting loose discussions (https://discuss.frappe.io/t/shopping-cart-logic/43263/20) , with something as important as this, that as I said in the webshop telegram group, it's unbelievable that they don't assign someone as repository leader.

I saw great input from you, it would be great to have the others involved in this issue or in a single thread.

blaggacao commented 3 months ago

I'm currently refactoring frappe/payments#53 - without a repository leader. :-)

But my idea is to prepare the groundwork for a checkout feature.

federicocalvo commented 3 months ago

@blaggacao awesome work, like others you have too, but we need the repository leader to accept your PRs 😅

blaggacao commented 3 months ago

Next round: https://github.com/frappe/frappe/pull/25820 -- step by step, we may be getting there. :rocket:

federicocalvo commented 3 months ago

@blaggacao awesome!